Posts

Showing posts from October, 2019

Running Android and IOS app using Appium

Note:- To Run Android and IOS both test, You will have to install Android SDK (We use for Android apps) and XCode (We use for IOS apps). To install and work with XCode you should have MAC OS. You can not install XCode on windows. 1. Configure your Maven POM.XML file to bring all required dependencies to your project. Add Properties to pick the testng.xml file <properties>       <property>             <project.build.sourceEncodeing>UTF-8</project.build.sourceEncodeing>             <suiteXmlFile>testng.xml</suiteXmlFile>       </property> </properties> Add Dependencies <dependencies> <!-- https://mvnrepository.com/artifact/org.seleniumhq.selenium/selenium-java --> <dependency>     <groupId>org.seleniumhq.selenium</groupId>     <artifactId>selenium-java</artifactId>  ...

Reg Ex

A regular expression (sometimes called a rational expression) is a sequence of characters that define a search pattern, mainly for use in pattern matching with strings, or string matching, i.e. “find and replace”-like operations.(Wikipedia). Regular expressions are a generalized way to match patterns with sequences of characters. It is used in every programming language like C++, Java and Python. What is a regular expression and what makes it so important? Regex are used in  Google analytics  in URL matching in supporting search and replace in most popular editors like Sublime, Notepad++, Brackets, Google Docs and Microsoft word. Example : Regular expression for an email address : ^([a-zA-Z0-9_\-\.]+)@([a-zA-Z0-9_\-\.]+)\.([a-zA-Z]{2,5})$ The above regular expression can be used for checking if a given set of characters is an email address or not. How to write regular expression? Repeaters : * , + and { } :  These symbols act as repeaters and tell the comp...

Reading Writing Excel File in JAVA

Image
You might aware that Excel file now comes with two formats, XLS file which is an OLE format and XLSX format, which is also known as OpenXML format. Apache POI supports both format but you would need different JAR files to read/write XLS and XLSX files. You need  poi-3.12.jar  to read XLS file and  poi-ooxml-3.12.jar  to read XLSX file in Java. You can write different OLE formats using  poi-3.12.jar for example you can also use this JAR to read Microsoft Word files witch .DOC extension and Microsoft PowerPoint files with .PPT extension in Java. Similarly you can read other OpenXML format e.g. DOCX and PPTX using  poi-ooxml-3.12.jar  file. It's very important to understand which JAR files you need to read which kind of Excel files in Java, because classes used to read different Excel file format are different e.g. to read old Excel file format i.e.  XLS  files you need  HSSFWorkbook  class, which is inside  poi-XX.jar , while cl...

API Automation using Rest Assured

Image
REST API Test using Rest Assured This test will hit a simple Restful web service. Details of the Restful Web service are mentioned in the below table:   Endpoint   http://restapi.demoqa.com/utilities/weather/city/<City> HTTP method type :   GET   Comments :   Here  <City>  means the city for which we are trying to retrieve the weather data. For e.g. if you want to know the weather conditions of Hyderabad, you would simple replace the  <City>  text with  Hyderabad.  The Restful resource URL for Hyderabad becomes:  http://restapi.demoqa.com/utilities/weather/city/Hyderabad   Response { “City”: “Hyderabad”, “Temperature”: “31.49 Degree celsius”, “Humidity”: “62 Percent”, “Weather Description”: “scattered clouds”, “Wind Speed”: “3.6 Km per hour”, “Wind Direction degree”: “270 Degree” } Why not just try to open  http://restapi.demoqa.com/utilities/weather/city/Hyderabad ...