SlideShare a Scribd company logo
1 of 5
Download to read offline
APPIUM UNDERSTANDING DOCUMENT
What is Appium?
Appium is an open source test automation tool for mobile applications. It allows you to test all the three
types of mobile applications: native, hybrid and mobile web. It also allows you to run the automated
tests on actual devices, emulators and simulators. Today when every mobile app is made in at least two
platform iOS and Android, you for sure need a tool, which allows testing cross platform. Having two
different frameworks for the same app increases the cost of the product and time to maintain it as well.
The basic philosophy of Appium is that you should be able to reuse code between iOS and Android, and
that’s why when you see the API they are same across iOS and android. Another important thing to
highlight here is that Appium doesn’t modify your app or need you to even recompile the app. Appium
lets you choose the language you want to write your test in. It doesn’t dictate the language or
framework to be used.
Appium Architecture:-
Below is a diagram which explains how Appium works:
 Automation commands are sent in the form of JSON via HTTP requests.
 JavaScript Object Notation (JSON) is primarily used to transfer data between a server & a client
on the web
 Appium server establishes a session with the client & sends command to the target device based
on the desired capabilities the Appium has received.
 Desired capabilities are a set of keys and values (i.e., a map or hash) sent to the Appium server
to tell the server what kind of automation session we’re interested in starting up.
 With uiautomatorviewer, you can inspect the UI of an application in order to find the layout
hierarchy and view the properties of the individual UI components of an application.
Appium System Installation Guide:-
 Pre-requisites for Appium Installation :-
 Installation of JDK 1.7 or higher
 Installation of Android SDK
 Eclipse IDE of your choice
 Android Requirements :
 Install Android SDK API >=17
Step by Step Installation Guide:
 Download & Install .NET Framework 4.5 (if not installed earlier on your machine)
 Download & install JDK 7 & higher
 Set Java Home & path in the Environment Variables
 Download Eclipse
 Install TestNG from Eclipse marketplace
 Enable developer mode on your Android mobile
 Download Android SDK
 Set Android Home & path in the Environment Variables
 Open SDK Manager & update all the Android API levels which are greater than level 17
 Download & install latest Appium executable from
https://bitbucket.org/appium/appium.app/downloads/ (the current latest version is 1.3.7.2)
 Download Appium client libraries from
https://search.maven.org/#search%7Cga%7C1%7Cg%3Aio.appium%20a%3Ajava-client (Appium
java-client 2.2.0 .jar)
 Download Selenium jars from http://docs.seleniumhq.org/download/ for java (latest version is
2.45.0)
 Download gson.jar for appium from
http://mvnrepository.com/artifact/com.google.code.gson/gson/2.2.4
 Download Node.js & install from https://nodejs.org/
Steps to create and run android test script:
1. Go to Appium downloaded package unzip and click on “Appium.exe”. Appium server console will be
open like below:
2. You can change IP address to the IP of your local machine. Keep the port as default i.e. 4723.
3. Click on Launch button to run Appium server you should see Appium server running window like
below
4. Launch emulator or connect device to the machine. Run adb command from command prompt to
check device is connected to your machine.
5. Below is sample code of webdriver in java for Appium in TestNg framework.
Sample Code:-
import java.io.File;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.concurrent.TimeUnit;
import org.openqa.selenium.By;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.remote.DesiredCapabilities;
import org.openqa.selenium.remote.RemoteWebDriver;
import org.openqa.selenium.remote.server.handler.interactions.touch.Flick;
import org.testng.annotations.Test;
import io.appium.java_client.InteractsWithApps;
import io.appium.java_client.SwipeElementDirection;
import io.appium.java_client.android.AndroidDriver;
public class WhatsApp {
AndroidDriver driver;
@Test
public void testWhatsApp() throws MalformedURLException {
DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.setCapability("deviceName", "D6502");
capabilities.setCapability("platformVersion", "5.0.2");
capabilities.setCapability("platformName", "Android");
File file = new File("E:AKSHAYassignmentsSelenium_WorkspaceAppium
TestapkWhatsApp.apk");
capabilities.setCapability("app", file.getAbsolutePath());
capabilities.setCapability("app-package", "com.whatsapp");
capabilities.setCapability("app-activity", ".HomeActivity");
driver = new AndroidDriver(new URL("http://10.0.1.20:4723/wd/hub"),
capabilities);
driver.manage().timeouts().implicitlyWait(3, TimeUnit.SECONDS);
driver.findElementById("com.whatsapp:id/menuitem_search").click();
WebElement text = driver.findElementByClassName("android.widget.EditText");
driver.manage().timeouts().implicitlyWait(3, TimeUnit.SECONDS);
text.sendKeys("cd kitne");
driver.manage().timeouts().implicitlyWait(3, TimeUnit.SECONDS);
driver.findElementById("com.whatsapp:id/conversations_row_contact_name").click();
driver.manage().timeouts().implicitlyWait(3, TimeUnit.SECONDS);
for(int i=0;i<4;i++){
driver.manage().timeouts().implicitlyWait(3, TimeUnit.SECONDS);
driver.findElementById("com.whatsapp:id/entry").sendKeys("Hi Guys..");
driver.findElementById("com.whatsapp:id/send").click();
}
driver.closeApp();
}
}
The above Sample code is used to automate WhatsApp in which message is sent to a WhatsApp group
on execution of code.
Automating Gestures:-
Gestures play an important role in how your app is being used. With lot of unique gesture supported on
mobile devices, automation has its own challenge. Some of the common gestures are:
 single tap
 double tap
 flick (left or right)
 pull down to refresh
 long press
Appium handles these gestures using TouchActions api they have created. It’s more like Actions class in
Selenium. Apart from that they have also enabled JSON wire protocol server extensions. We can pass in
coordinates as parameters and specify the action we want. Sample code would look like as:
JavascriptExecutor js = (JavascriptExecutor) driver;
HashMap<String, Double> swipeObject = new HashMap<String, Double>();
swipeObject.put(“startX”, 0.01);
swipeObject.put(“startY”, 0.5);
swipeObject.put(“endX”, 0.9);
swipeObject.put(“endY”, 0.6);
swipeObject.put(“duration”, 3.0);
js.executeScript(“mobile: swipe”, swipeObject);
When we enter the coordinates in decimal, it actually specifies the percentage. So in above example it
means, 1% from x and 50% from y coordinates. Duration basically specifies how long it will tap and is in
seconds.
Some of the mobile methods to be used are:
 mobile: tap
 mobile: flick
 mobile: swipe
 mobile: scroll
 mobile: shake
Prefix “mobile:” allows us to route these requests to the appropriate endpoint.
TouchActions class provided by Selenium. It implements actions for touch devices and basically built
upon the Actions class.

More Related Content

What's hot

Automation Testing With Appium
Automation Testing With AppiumAutomation Testing With Appium
Automation Testing With AppiumKnoldus Inc.
 
Getting started with appium
Getting started with appiumGetting started with appium
Getting started with appiumPratik Patel
 
Appium@Work at PAYBACK
Appium@Work at PAYBACKAppium@Work at PAYBACK
Appium@Work at PAYBACKMarcel Gehlen
 
Android UI Testing with Appium
Android UI Testing with AppiumAndroid UI Testing with Appium
Android UI Testing with AppiumLuke Maung
 
Appium: Mobile Automation Made Awesome
Appium: Mobile Automation Made AwesomeAppium: Mobile Automation Made Awesome
Appium: Mobile Automation Made AwesomeNetcetera
 
Testing Native iOS Apps with Appium
Testing Native iOS Apps with AppiumTesting Native iOS Apps with Appium
Testing Native iOS Apps with AppiumSauce Labs
 
Selenium webcrawler
Selenium webcrawlerSelenium webcrawler
Selenium webcrawlerRabia Khalid
 
Parallel Test Runs with Appium on Real Mobile Devices – Hands-on Webinar
Parallel Test Runs with Appium on Real Mobile Devices – Hands-on WebinarParallel Test Runs with Appium on Real Mobile Devices – Hands-on Webinar
Parallel Test Runs with Appium on Real Mobile Devices – Hands-on WebinarBitbar
 
Appium Meetup #2 - Mobile Web Automation Introduction
Appium Meetup #2 - Mobile Web Automation IntroductionAppium Meetup #2 - Mobile Web Automation Introduction
Appium Meetup #2 - Mobile Web Automation Introductionsnevesbarros
 
Using Selenium to Test Native Apps (Wait, you can do that?)
Using Selenium to Test Native Apps (Wait, you can do that?)Using Selenium to Test Native Apps (Wait, you can do that?)
Using Selenium to Test Native Apps (Wait, you can do that?)Sauce Labs
 
Android & iOS Automation Using Appium
Android & iOS Automation Using AppiumAndroid & iOS Automation Using Appium
Android & iOS Automation Using AppiumMindfire Solutions
 
Automation With Appium
Automation With AppiumAutomation With Appium
Automation With AppiumKnoldus Inc.
 
Future of Mobile Automation, Appium Steals it
Future of Mobile Automation, Appium Steals itFuture of Mobile Automation, Appium Steals it
Future of Mobile Automation, Appium Steals itSrinivasan Sekar
 

What's hot (20)

Automation Testing With Appium
Automation Testing With AppiumAutomation Testing With Appium
Automation Testing With Appium
 
BCS Selenium Workshop
BCS Selenium WorkshopBCS Selenium Workshop
BCS Selenium Workshop
 
Getting started with appium
Getting started with appiumGetting started with appium
Getting started with appium
 
Appium
AppiumAppium
Appium
 
Appium@Work at PAYBACK
Appium@Work at PAYBACKAppium@Work at PAYBACK
Appium@Work at PAYBACK
 
Android UI Testing with Appium
Android UI Testing with AppiumAndroid UI Testing with Appium
Android UI Testing with Appium
 
Appium: Mobile Automation Made Awesome
Appium: Mobile Automation Made AwesomeAppium: Mobile Automation Made Awesome
Appium: Mobile Automation Made Awesome
 
Testing Native iOS Apps with Appium
Testing Native iOS Apps with AppiumTesting Native iOS Apps with Appium
Testing Native iOS Apps with Appium
 
Appium ppt
Appium pptAppium ppt
Appium ppt
 
Appium & Jenkins
Appium & JenkinsAppium & Jenkins
Appium & Jenkins
 
#Fame case study
#Fame case study#Fame case study
#Fame case study
 
Automated UI Testing Frameworks
Automated UI Testing FrameworksAutomated UI Testing Frameworks
Automated UI Testing Frameworks
 
Appium
AppiumAppium
Appium
 
Selenium webcrawler
Selenium webcrawlerSelenium webcrawler
Selenium webcrawler
 
Parallel Test Runs with Appium on Real Mobile Devices – Hands-on Webinar
Parallel Test Runs with Appium on Real Mobile Devices – Hands-on WebinarParallel Test Runs with Appium on Real Mobile Devices – Hands-on Webinar
Parallel Test Runs with Appium on Real Mobile Devices – Hands-on Webinar
 
Appium Meetup #2 - Mobile Web Automation Introduction
Appium Meetup #2 - Mobile Web Automation IntroductionAppium Meetup #2 - Mobile Web Automation Introduction
Appium Meetup #2 - Mobile Web Automation Introduction
 
Using Selenium to Test Native Apps (Wait, you can do that?)
Using Selenium to Test Native Apps (Wait, you can do that?)Using Selenium to Test Native Apps (Wait, you can do that?)
Using Selenium to Test Native Apps (Wait, you can do that?)
 
Android & iOS Automation Using Appium
Android & iOS Automation Using AppiumAndroid & iOS Automation Using Appium
Android & iOS Automation Using Appium
 
Automation With Appium
Automation With AppiumAutomation With Appium
Automation With Appium
 
Future of Mobile Automation, Appium Steals it
Future of Mobile Automation, Appium Steals itFuture of Mobile Automation, Appium Steals it
Future of Mobile Automation, Appium Steals it
 

Viewers also liked

Testing Your Android and iOS Apps with Appium in Testdroid Cloud
Testing Your Android and iOS Apps with Appium in Testdroid CloudTesting Your Android and iOS Apps with Appium in Testdroid Cloud
Testing Your Android and iOS Apps with Appium in Testdroid CloudBitbar
 
Activity based costing
Activity based costingActivity based costing
Activity based costingamouqe
 
台南市腦性麻痺之友協會介紹
台南市腦性麻痺之友協會介紹台南市腦性麻痺之友協會介紹
台南市腦性麻痺之友協會介紹輝 哲
 
Dieta e prevenção cvd versão slideshare
Dieta e prevenção cvd versão slideshareDieta e prevenção cvd versão slideshare
Dieta e prevenção cvd versão slidesharenutriscience
 
01廖麗萍
01廖麗萍01廖麗萍
01廖麗萍輝 哲
 
NARRAR POR ESCRITO DESDE UN PERSONAJE Ferreiro Emilia
NARRAR  POR  ESCRITO DESDE UN PERSONAJE Ferreiro Emilia NARRAR  POR  ESCRITO DESDE UN PERSONAJE Ferreiro Emilia
NARRAR POR ESCRITO DESDE UN PERSONAJE Ferreiro Emilia María Julia Bravo
 
07陳思樺
07陳思樺07陳思樺
07陳思樺輝 哲
 
Joanna masiubanska podrozni festival
Joanna masiubanska podrozni festivalJoanna masiubanska podrozni festival
Joanna masiubanska podrozni festivalJoanna Masiubańska
 
El pèsol Negre. Número 4. Maig 2001 (2a època)
El pèsol Negre. Número 4. Maig 2001 (2a època)El pèsol Negre. Número 4. Maig 2001 (2a època)
El pèsol Negre. Número 4. Maig 2001 (2a època)Cgtmanresa Bages
 
Ludology presentation
Ludology presentationLudology presentation
Ludology presentationD.I.T
 
المجلة السودانية لدراسات الراي العام
المجلة السودانية لدراسات الراي العامالمجلة السودانية لدراسات الراي العام
المجلة السودانية لدراسات الراي العامHamza Omer
 
Међумолекулске интеракције и водонична веза
Међумолекулске интеракције и водонична везаМеђумолекулске интеракције и водонична веза
Међумолекулске интеракције и водонична везаTanja Milanović
 

Viewers also liked (20)

Testing Your Android and iOS Apps with Appium in Testdroid Cloud
Testing Your Android and iOS Apps with Appium in Testdroid CloudTesting Your Android and iOS Apps with Appium in Testdroid Cloud
Testing Your Android and iOS Apps with Appium in Testdroid Cloud
 
Activity based costing
Activity based costingActivity based costing
Activity based costing
 
台南市腦性麻痺之友協會介紹
台南市腦性麻痺之友協會介紹台南市腦性麻痺之友協會介紹
台南市腦性麻痺之友協會介紹
 
Pepsi
PepsiPepsi
Pepsi
 
Dieta e prevenção cvd versão slideshare
Dieta e prevenção cvd versão slideshareDieta e prevenção cvd versão slideshare
Dieta e prevenção cvd versão slideshare
 
Jonas biliunas
Jonas biliunasJonas biliunas
Jonas biliunas
 
Genç Liderler
Genç LiderlerGenç Liderler
Genç Liderler
 
Positive mind set
Positive mind setPositive mind set
Positive mind set
 
01廖麗萍
01廖麗萍01廖麗萍
01廖麗萍
 
NARRAR POR ESCRITO DESDE UN PERSONAJE Ferreiro Emilia
NARRAR  POR  ESCRITO DESDE UN PERSONAJE Ferreiro Emilia NARRAR  POR  ESCRITO DESDE UN PERSONAJE Ferreiro Emilia
NARRAR POR ESCRITO DESDE UN PERSONAJE Ferreiro Emilia
 
07陳思樺
07陳思樺07陳思樺
07陳思樺
 
Occlusion
OcclusionOcclusion
Occlusion
 
Joanna masiubanska podrozni festival
Joanna masiubanska podrozni festivalJoanna masiubanska podrozni festival
Joanna masiubanska podrozni festival
 
El pèsol Negre. Número 4. Maig 2001 (2a època)
El pèsol Negre. Número 4. Maig 2001 (2a època)El pèsol Negre. Número 4. Maig 2001 (2a època)
El pèsol Negre. Número 4. Maig 2001 (2a època)
 
Ludology presentation
Ludology presentationLudology presentation
Ludology presentation
 
Old trafford
Old traffordOld trafford
Old trafford
 
المجلة السودانية لدراسات الراي العام
المجلة السودانية لدراسات الراي العامالمجلة السودانية لدراسات الراي العام
المجلة السودانية لدراسات الراي العام
 
Curriculo nacional-2016-
Curriculo nacional-2016-Curriculo nacional-2016-
Curriculo nacional-2016-
 
Pedoman pkm tahun 2015
Pedoman pkm tahun 2015Pedoman pkm tahun 2015
Pedoman pkm tahun 2015
 
Међумолекулске интеракције и водонична веза
Међумолекулске интеракције и водонична везаМеђумолекулске интеракције и водонична веза
Међумолекулске интеракције и водонична веза
 

Similar to Appium understanding document

The ultimate guide to mobile app testing with appium
The ultimate guide to mobile app testing with appiumThe ultimate guide to mobile app testing with appium
The ultimate guide to mobile app testing with appiumheadspin2
 
Selenium, Appium, and Robots!
Selenium, Appium, and Robots!Selenium, Appium, and Robots!
Selenium, Appium, and Robots!hugs
 
Designing an effective hybrid apps automation framework
Designing an effective hybrid apps automation frameworkDesigning an effective hybrid apps automation framework
Designing an effective hybrid apps automation frameworkAndrea Tino
 
Appium Presentation
Appium Presentation Appium Presentation
Appium Presentation OmarUsman6
 
appiumpresent-211128171811.pptx projet de presentation
appiumpresent-211128171811.pptx projet de presentationappiumpresent-211128171811.pptx projet de presentation
appiumpresent-211128171811.pptx projet de presentationEnochBidima3
 
Android Automation Using Robotium
Android Automation Using RobotiumAndroid Automation Using Robotium
Android Automation Using RobotiumMindfire Solutions
 
Decoding Appium No-Code Test Automation With HeadSpin.pdf
Decoding Appium No-Code Test Automation With HeadSpin.pdfDecoding Appium No-Code Test Automation With HeadSpin.pdf
Decoding Appium No-Code Test Automation With HeadSpin.pdfkalichargn70th171
 
Fastlane - Automation and Continuous Delivery for iOS Apps
Fastlane - Automation and Continuous Delivery for iOS AppsFastlane - Automation and Continuous Delivery for iOS Apps
Fastlane - Automation and Continuous Delivery for iOS AppsSarath C
 
Building And Executing Test Cases with Appium and Various Test Frameworks.pdf
Building And Executing Test Cases with Appium and Various Test Frameworks.pdfBuilding And Executing Test Cases with Appium and Various Test Frameworks.pdf
Building And Executing Test Cases with Appium and Various Test Frameworks.pdfpCloudy
 
Setting UIAutomation free with Appium
Setting UIAutomation free with AppiumSetting UIAutomation free with Appium
Setting UIAutomation free with AppiumDan Cuellar
 
Mobile automation using Appium
Mobile automation using AppiumMobile automation using Appium
Mobile automation using AppiumSaroj Singh
 

Similar to Appium understanding document (20)

Browser_Stack_Intro
Browser_Stack_IntroBrowser_Stack_Intro
Browser_Stack_Intro
 
Next level of Appium
Next level of AppiumNext level of Appium
Next level of Appium
 
The ultimate guide to mobile app testing with appium
The ultimate guide to mobile app testing with appiumThe ultimate guide to mobile app testing with appium
The ultimate guide to mobile app testing with appium
 
Automation using Appium
Automation using AppiumAutomation using Appium
Automation using Appium
 
Selenium, Appium, and Robots!
Selenium, Appium, and Robots!Selenium, Appium, and Robots!
Selenium, Appium, and Robots!
 
Appium.pptx
Appium.pptxAppium.pptx
Appium.pptx
 
Android CI and Appium
Android CI and AppiumAndroid CI and Appium
Android CI and Appium
 
Designing an effective hybrid apps automation framework
Designing an effective hybrid apps automation frameworkDesigning an effective hybrid apps automation framework
Designing an effective hybrid apps automation framework
 
Appium Presentation
Appium Presentation Appium Presentation
Appium Presentation
 
Appium solution artizone
Appium solution   artizoneAppium solution   artizone
Appium solution artizone
 
appiumpresent-211128171811.pptx projet de presentation
appiumpresent-211128171811.pptx projet de presentationappiumpresent-211128171811.pptx projet de presentation
appiumpresent-211128171811.pptx projet de presentation
 
Android Automation Using Robotium
Android Automation Using RobotiumAndroid Automation Using Robotium
Android Automation Using Robotium
 
Decoding Appium No-Code Test Automation With HeadSpin.pdf
Decoding Appium No-Code Test Automation With HeadSpin.pdfDecoding Appium No-Code Test Automation With HeadSpin.pdf
Decoding Appium No-Code Test Automation With HeadSpin.pdf
 
Fastlane - Automation and Continuous Delivery for iOS Apps
Fastlane - Automation and Continuous Delivery for iOS AppsFastlane - Automation and Continuous Delivery for iOS Apps
Fastlane - Automation and Continuous Delivery for iOS Apps
 
Sencha Touch MVC
Sencha Touch MVCSencha Touch MVC
Sencha Touch MVC
 
Building And Executing Test Cases with Appium and Various Test Frameworks.pdf
Building And Executing Test Cases with Appium and Various Test Frameworks.pdfBuilding And Executing Test Cases with Appium and Various Test Frameworks.pdf
Building And Executing Test Cases with Appium and Various Test Frameworks.pdf
 
Appium- part 1
Appium- part 1Appium- part 1
Appium- part 1
 
Mobile DevTest Dictionary
Mobile DevTest DictionaryMobile DevTest Dictionary
Mobile DevTest Dictionary
 
Setting UIAutomation free with Appium
Setting UIAutomation free with AppiumSetting UIAutomation free with Appium
Setting UIAutomation free with Appium
 
Mobile automation using Appium
Mobile automation using AppiumMobile automation using Appium
Mobile automation using Appium
 

Recently uploaded

Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2Hyundai Motor Group
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptxLBM Solutions
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?XfilesPro
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...HostedbyConfluent
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAndikSusilo4
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxOnBoard
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 

Recently uploaded (20)

Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptx
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & Application
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping Elbows
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptx
 
The transition to renewables in India.pdf
The transition to renewables in India.pdfThe transition to renewables in India.pdf
The transition to renewables in India.pdf
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 

Appium understanding document

  • 1. APPIUM UNDERSTANDING DOCUMENT What is Appium? Appium is an open source test automation tool for mobile applications. It allows you to test all the three types of mobile applications: native, hybrid and mobile web. It also allows you to run the automated tests on actual devices, emulators and simulators. Today when every mobile app is made in at least two platform iOS and Android, you for sure need a tool, which allows testing cross platform. Having two different frameworks for the same app increases the cost of the product and time to maintain it as well. The basic philosophy of Appium is that you should be able to reuse code between iOS and Android, and that’s why when you see the API they are same across iOS and android. Another important thing to highlight here is that Appium doesn’t modify your app or need you to even recompile the app. Appium lets you choose the language you want to write your test in. It doesn’t dictate the language or framework to be used. Appium Architecture:- Below is a diagram which explains how Appium works:  Automation commands are sent in the form of JSON via HTTP requests.  JavaScript Object Notation (JSON) is primarily used to transfer data between a server & a client on the web  Appium server establishes a session with the client & sends command to the target device based on the desired capabilities the Appium has received.  Desired capabilities are a set of keys and values (i.e., a map or hash) sent to the Appium server to tell the server what kind of automation session we’re interested in starting up.  With uiautomatorviewer, you can inspect the UI of an application in order to find the layout hierarchy and view the properties of the individual UI components of an application.
  • 2. Appium System Installation Guide:-  Pre-requisites for Appium Installation :-  Installation of JDK 1.7 or higher  Installation of Android SDK  Eclipse IDE of your choice  Android Requirements :  Install Android SDK API >=17 Step by Step Installation Guide:  Download & Install .NET Framework 4.5 (if not installed earlier on your machine)  Download & install JDK 7 & higher  Set Java Home & path in the Environment Variables  Download Eclipse  Install TestNG from Eclipse marketplace  Enable developer mode on your Android mobile  Download Android SDK  Set Android Home & path in the Environment Variables  Open SDK Manager & update all the Android API levels which are greater than level 17  Download & install latest Appium executable from https://bitbucket.org/appium/appium.app/downloads/ (the current latest version is 1.3.7.2)  Download Appium client libraries from https://search.maven.org/#search%7Cga%7C1%7Cg%3Aio.appium%20a%3Ajava-client (Appium java-client 2.2.0 .jar)  Download Selenium jars from http://docs.seleniumhq.org/download/ for java (latest version is 2.45.0)  Download gson.jar for appium from http://mvnrepository.com/artifact/com.google.code.gson/gson/2.2.4  Download Node.js & install from https://nodejs.org/
  • 3. Steps to create and run android test script: 1. Go to Appium downloaded package unzip and click on “Appium.exe”. Appium server console will be open like below: 2. You can change IP address to the IP of your local machine. Keep the port as default i.e. 4723. 3. Click on Launch button to run Appium server you should see Appium server running window like below 4. Launch emulator or connect device to the machine. Run adb command from command prompt to check device is connected to your machine. 5. Below is sample code of webdriver in java for Appium in TestNg framework. Sample Code:- import java.io.File; import java.net.MalformedURLException; import java.net.URL; import java.util.concurrent.TimeUnit;
  • 4. import org.openqa.selenium.By; import org.openqa.selenium.WebElement; import org.openqa.selenium.remote.DesiredCapabilities; import org.openqa.selenium.remote.RemoteWebDriver; import org.openqa.selenium.remote.server.handler.interactions.touch.Flick; import org.testng.annotations.Test; import io.appium.java_client.InteractsWithApps; import io.appium.java_client.SwipeElementDirection; import io.appium.java_client.android.AndroidDriver; public class WhatsApp { AndroidDriver driver; @Test public void testWhatsApp() throws MalformedURLException { DesiredCapabilities capabilities = new DesiredCapabilities(); capabilities.setCapability("deviceName", "D6502"); capabilities.setCapability("platformVersion", "5.0.2"); capabilities.setCapability("platformName", "Android"); File file = new File("E:AKSHAYassignmentsSelenium_WorkspaceAppium TestapkWhatsApp.apk"); capabilities.setCapability("app", file.getAbsolutePath()); capabilities.setCapability("app-package", "com.whatsapp"); capabilities.setCapability("app-activity", ".HomeActivity"); driver = new AndroidDriver(new URL("http://10.0.1.20:4723/wd/hub"), capabilities); driver.manage().timeouts().implicitlyWait(3, TimeUnit.SECONDS); driver.findElementById("com.whatsapp:id/menuitem_search").click(); WebElement text = driver.findElementByClassName("android.widget.EditText"); driver.manage().timeouts().implicitlyWait(3, TimeUnit.SECONDS); text.sendKeys("cd kitne"); driver.manage().timeouts().implicitlyWait(3, TimeUnit.SECONDS); driver.findElementById("com.whatsapp:id/conversations_row_contact_name").click(); driver.manage().timeouts().implicitlyWait(3, TimeUnit.SECONDS); for(int i=0;i<4;i++){ driver.manage().timeouts().implicitlyWait(3, TimeUnit.SECONDS); driver.findElementById("com.whatsapp:id/entry").sendKeys("Hi Guys.."); driver.findElementById("com.whatsapp:id/send").click(); } driver.closeApp(); } }
  • 5. The above Sample code is used to automate WhatsApp in which message is sent to a WhatsApp group on execution of code. Automating Gestures:- Gestures play an important role in how your app is being used. With lot of unique gesture supported on mobile devices, automation has its own challenge. Some of the common gestures are:  single tap  double tap  flick (left or right)  pull down to refresh  long press Appium handles these gestures using TouchActions api they have created. It’s more like Actions class in Selenium. Apart from that they have also enabled JSON wire protocol server extensions. We can pass in coordinates as parameters and specify the action we want. Sample code would look like as: JavascriptExecutor js = (JavascriptExecutor) driver; HashMap<String, Double> swipeObject = new HashMap<String, Double>(); swipeObject.put(“startX”, 0.01); swipeObject.put(“startY”, 0.5); swipeObject.put(“endX”, 0.9); swipeObject.put(“endY”, 0.6); swipeObject.put(“duration”, 3.0); js.executeScript(“mobile: swipe”, swipeObject); When we enter the coordinates in decimal, it actually specifies the percentage. So in above example it means, 1% from x and 50% from y coordinates. Duration basically specifies how long it will tap and is in seconds. Some of the mobile methods to be used are:  mobile: tap  mobile: flick  mobile: swipe  mobile: scroll  mobile: shake Prefix “mobile:” allows us to route these requests to the appropriate endpoint. TouchActions class provided by Selenium. It implements actions for touch devices and basically built upon the Actions class.