Posts

Appium : Getting Started

Appium Install the desktop appium download appium java binding io.appium:java-client:7.3.0 Getting started code DesiredCapabilities desiredCapabilities = new DesiredCapabilities (); desiredCapabilities . setCapability ( MobileCapabilityType . PLATFORM_VERSION , "6.0.1" ); desiredCapabilities . setCapability ( MobileCapabilityType . PLATFORM_NAME , "Android" ); desiredCapabilities . setCapability ( MobileCapabilityType . DEVICE_NAME , "840f9a04" ); desiredCapabilities . setCapability ( MobileCapabilityType . AUTOMATION_NAME , "appium" ); desiredCapabilities . setCapability ( MobileCapabilityType . APP , "C:\\Users\\sapan\\Downloads\\fbox.apk" ); ​ URL url = new URL ( "http://0.0.0.0:4723/wd/hub" ); ​ AndroidDriver driver = new AndroidDriver ( url , desiredCapabilities ); String sessionId = driver . getSessionId (). toString (); ...

Install Appium : Part 1

Image
To test mobile mobile app, there are various framework available. Appium is one of them, Appium is an open source test automation framework for use with native, hybrid and mobile web apps. It drives iOS, Android, and Windows apps using the WebDriver protocol. In this Part We will download all the required software and library. #Download JDK 1.Go to oracle site . 2. click Java download. 3.New Page will open. 4.Accept the license agreement and download the jdk depending on your os. like : jdk-8u131-windows-x64.exe 5. Now Install the JDK 6. Now Configure the JDK environment by its install directory to the PATH and Add JAVA_HOME variable # Download Appium 1.Go to site  http://appium.io/ 2.Click Download Appium on the site. 3.It will navigate to the Github download page. Click the setup depending upon your OS. In my case it is  appium-desktop-Setup-1.1.0-beta.4.exe 4.Now install the downloaded setup.(double click the downloaded file to install i...

Testing Webhooks

Image
Ever encounter a situation where you need to test the request send by your application to another system. Eg : like when ever you are making changes in your application triggers a request send from your application to other server. Now you need to check if the request send by your server is correct or not. To test this type of scenerio you can use RequestDump . This the server which will dump all the request from your server to this server. Now how to use this. This is the nodejs application which you need to run on your server. Follow the instruction on the github page to install this application. Now suppose you  started server on machine with IP : 172.168.10.100 Then configure your application to send request to IP 172.168.10.100:3000/anything Now in your browser open  172.168.10.100:3000/log this will open the log page. This will show all the dump request send to your server.

TestNG Annotations Basics

Image
Here are the list of basic TestNG Annotations and there execution order. Annotations  @BeforeSuite The annotated method will be run before all tests in this suite have run. @AfterSuite The annotated method will be run after all tests in this suite have run. @BeforeTest The annotated method will be run before any test method belonging to the classes inside the <test> tag is run.  i.e @Test @AfterTest The annotated method will be run after all the test methods belonging to the classes inside the <test> tag have run. i.e @Test @BeforeClass The annotated method will be run before the first test method in the current class is invoked. @AfterClass The annotated method will be run after all the test methods in the current class have been run. @BeforeMethod The annotated method will be run before each test method. @AfterMethod The annotated method will be run after each test method. @BeforeGroups The list of...

Install TestNg in Eclipse

Image
In this post I will be installing Testng plugin in eclipse. Open eclipse Go to help -> Eclipse Marketplace Search for Testng Click Install for "TestNg for Eclipse" To check if Testng has been installed sucessfully create new java project. Add New Java File. And paste the code. 1 2 3 4 5 6 7 8 9 10 11 import org.testng.annotations.Test ; public class A { @Test public void t1 () { System . out . println ( "Test 1" ); } } In the quick Fix dialog add Testng library. Now Right click java file then Run as -> Test Ng test Now the Test should Execute Successfully. Video Tutorial :

Getting Started With Selenium : Part 2

Image
In the previous post we have setup our selenium environment. Now we can write our first selenium script. 1. In the Project Explorer Right click package 'com' which was created earlier. And create a class Inside it. 3. Now In the editor copy and paste the code. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 package com ; import org.openqa.selenium.By ; import org.openqa.selenium.WebDriver ; import org.openqa.selenium.WebElement ; import org.openqa.selenium.chrome.ChromeDriver ; public class Test1 { public static void main ( String [] args ) throws Exception { System . setProperty ( "webdriver.chrome.driver" , "drivers/chromedriver.exe" ); WebDriver driver = new ChromeDriver (); driver . get ( "http://www.google.com/xhtml" ); Thread . sleep ( 5000 ); // Let the user actually see something! WebElement searchBox = driver . findElement ( By . name ( "q" ))...

Getting Started With Selenium : Part 1

Image
Getting started with selenium is very easy. First you need to have some basic requirement, before you start using selenium. 1.Your favourite programming language. 2.It's Programming IDE 3.Selenium library for language 4.Driver for the browser you want to use. For this tutor I will be using Java,Eclipse and chrome driver. #Download the JDK Download the Java JDK from  Oracle Site Download the Jdk depending upon your OS. #Download the Eclipse Download  Eclipse IDE for Java Developers   (download any latest version). # Download the required library For using using selenium,First you need to get the required library for this tutor we will download the standalone jar. 1. Navigate to URL :  http://www.seleniumhq.org/ 2.Click on Download tab 3.Now download the  Selenium Standalone Server 4.Click on the link which shows the version. like 3.4.0, it will start download of .jar file. #Download the driver Now to run  sel...