[Beta Version]

Last Updated: 10/May/2017


1.     Note

2.     Why Automation

3.     Why Appium

4.     How Appium Works

5.     API ( Ruby )

6.     SCM , CI

7.     Efficient Ways of Bugs Tracking & TC Management – My Views

8.     Appium Project Bugs Reporting

9.     Useful Links ( WIP )

10.   Elements Locator Strategy

11 .  Grid Setup, Parallel Execution

12.   Continuous Integration


Mark Watney Quote from The Martian movie At some point, everything’s gonna go

south   on you and you’re going to say, this is it. This is how I end. Now you can either

accept that,   or you can get to work. That’s all it is. You just begin. You do the math. You

solve one  problem and you solve the next one, and then the next. And If you solve enough

problems,   you get to come home.” [ so true; in everyday’s work of Automation Engineer ]


1. Note:

I’m from Web Automation background , working with Selenium + Java.

                Because of circumstance / compulsions had to use Ruby for Mobile Automation 🙂 But I feel it’s always good to have knowledge of one of the scripting language as well.

                This blog post is to share my learnings about Appium + Ruby, Java for Android & iOS automation native app UI automation.


2. Why Automation

If you and/or your boss/management is/are convinced about automation , then only do it otherwise it won’t be value add to yourself or project or company

Ok; below are the reasons why “I” ( was, am & will be convinced to ) do automation

– has got hundreds / thousand of test cases which need to be run on multiple devices , OS versions, multiple times as well

– can’t do it manually each time , as it’s boring and waste of manual time , energy etc

– Developers , Product Owner , Management wants quick ( as early as possible by a good QA engineer ) feedback on health of s/w

– just automate whatever is possible and run daily basis


3. Why Appium ?

– As it’s used by majority of companies ( Job Sites are easier way to find out which tools are used by majority of the companies 🙂 )

– It’s based on Selenium 2.0 , thus easy to get started in case you’re from web automation background


4. How Appium Works ?

( http://appium.io/introduction.html?lang=en )

http://nishantverma.gitbooks.io/appium-for-android/content/appium/why_appium.html – image

Appium – node.js server

Test Cases – any language supported by Selenium WebDriver API

AUT ( Emulator / Simulator / Device ) –  takes the Selenium commands from your test code and translates them into a readable format for UIAutomator, using the WebDriver JSON Wire Protocol.

Client/Server Architecture

Appium is at its heart a webserver that exposes a REST API.

1.1 It receives connections from a client

1.2 listens for commands

1.3 executes those commands on a mobile device

1.4 responds with an HTTP response representing the result of the command execution

we can write our test code in any language that has a http client API


info: Welcome to Appium v1.4.16 (REV ae6877eff263066b26328d457bd285c0cc62430d)

info: Appium REST http interface listener started on

info: Console LogLevel: debug


Automation is always performed in the context of a session. 

Clients initiate a session with a server in ways specific to each library, but they all end up sending a POST /session request to the server, with a JSON object called the ‘desired capabilities’ object. 

At this point the server will start up the automation session and respond with a session ID which is used for sending further commands.


info: –> POST /wd/hub/session {“desiredCapabilities”:{“platformName”:”iOS”,”platformVersion”:”9.2″,”udid”:”dc84c00dc6807d13d0997ee802e7faa4a26f65ba”,”deviceName”:null,”newCommandTimeout”:999999,”app”:”/Users/vikram-anna/Library/Developer/Xcode/DerivedData/wunderlist-ddifxljcmzpfdfgvqrmvjoepiisx/Build/Products/Development-iphoneos/Wunderlist.app”,”automationName”:”Appium”,”waitForAppScript”:”$.delay(3000); $.acceptAlert();”,”autoDismissAlerts”:true,”nativeInstrumentsLib”:true}}

info: Client User-Agent string: appium/ruby_lib/8.0.0

info: [debug] Using local app from desired caps: /Users/vikram-anna/Library/Developer/Xcode/DerivedData/wunderlist-ddifxljcmzpfdfgvqrmvjoepiisx/Build/Products/Development-iphoneos/Wunderlist.app

info: [debug] Creating new appium session 63dfcc4f-fc6a-48d0-8e0b-e8d46a4a6b39

info: [debug] Appium session started with sessionId 63dfcc4f-fc6a-48d0-8e0b-e8d46a4a6b39

info: [debug] Responding to client with success: {“status”:0,”value”:{“ELEMENT”:”60″},”sessionId”:”63dfcc4f-fc6a-48d0-8e0b-e8d46a4a6b39″}

info: data-blogger-escaped-comment—data-blogger-escaped-comment—data-blogger-escaped-comment—data-blogger-escaped-comment—data-blogger-escaped-comment—data-blogger-escaped-comment—data-blogger-escaped-comment—

info: –> POST /wd/hub/session/63dfcc4f-fc6a-48d0-8e0b-e8d46a4a6b39/element/60/click {}

Desired Capabilities

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


Android Capabilities

iOS Capabilities

Appium Server

Appium is a server written in Node.js

It can be built and installed from source or installed directly from NPM.

Appium Clients

There are client libraries (in Java, Ruby, Python, PHP, JavaScript, and C#) which support Appium’s extensions to the WebDriver protocol

When using Appium, you want to use these client libraries instead of your regular WebDriver client.

                     Appium webserver works quite similar to selenium server which recives http requests from selenium client libraries through JSON and then it handles those requests in different ways depending upon the platforms your are looking at. Appium has its own mechanism for iOS and Android.



5. API ( Ruby )

Refer below places to find out methods

1>  https://github.com/appium/ruby_lib/blob/master/docs/docs.md

2>  http://selenium.googlecode.com/git/docs/api/rb/index.html

3>  https://github.com/appium/ruby_lib/tree/master/docs

4>  http://www.rubydoc.info/github/appium/ruby_lib/Appium


6. SCM , Cloud CI

1> http://www.projecthut.com/version-control-systems-compared/

2> http://www.rightscale.com/blog/cloud-management-best-practices/continuous-integration-and-delivery-cloud-how-rightscale-does-it

7.   Efficient Ways Of Bugs Tracking & TC Management – My Views

1.  Human being is lazy by nature but QA engineer can’t & shouldn’t be 🙂 So just go ahead and write down user stories in SCM tool itself and get it reviewed with Development and Product Owner.

2. Keep revisiting / updating / adding / editing user stories based on bugs found during testing and by real users.

3. Map these user stories to automation scripts ( 1: 1 mapping to make sure no regression bugs are missed to production )

A BDD Lesson From My Past ( https://twitter.com/tonybruce77?lang=en

8.   Appium Project Bugs Reporting

In case you find any bug , just don’t complain in https://discuss.appium.io but file it under https://github.com/appium/appium/issues


9. Useful Links: ( TBR )

Appium Prime Cuts ( Webinar from Dan Cuellar – Saucelabs )

Adding Accessibility Identifiers to an iOS App

https://www.youtube.com/watch?v=ySglJIrDVMQ ( Appium v.1.6.0 – How to setup iOS Automation with XCUnitTest WebDriverAgentRunner )

Setup Appium on Mac OS to run automated tests from Java Classes on Android & iOS

https://github.com/SrinivasanTarget/awesome-appium ( A curated list of delightful Appium resources. )

http://shashikantjagtap.net/dockerising-appium-talk-at-appium-london-meetup/  ( Dockerising Appium

https://testobject.com/blog/2016/01/how-to-test-ios-apps-with-appium-on-os-x.html  ( How to Test iOS Apps with Appium on OS X – TestObject )

Appium iOS Provisioning Profilehttp://stackoverflow.com/questions/25733751/appium-provisioning-profile )




https://discuss.appium.io/t/appium-ios-app-testing/105/6  ( Refer to JessicaSachs answer )

http://mobiletest.engineer/ – Lots of useful info about Mobile Testing 

Get Involved – http://appium.io/get-involved.html

http://sauceio.com/index.php/tag/appium-bootcamp/ – BOOT CAMP

This section describes setup for Appium Ruby version.

Follow below blog from Dave Haeffner.



and chapter 2 ( link in above blog )


1. http://www.selenese.in/souce-lab-appium-blog/

2.  http://sauceio.com/index.php/2013/07/guest-post-mobile-testing-the-google-way-with-appium-sauce-labs/

3. http://sauceio.wordpress.com/tag/matthew-edwards/

http://www.atlantbh.com/appium-setting-up-mobile-automation-infrastructure-and-ci/ ( Appium , Real Devices , Jenkins , Appium + iOS + Jenkins , Appium + Android + Jenkins )

https://nishantverma.gitbooks.io/appium-for-android/content/index.html ( Appium for Android – online book )

https://www.utest.com/courses/how-to-set-up-your-first-android-automation-project-with-appium ( How to setup Your First Android Automation Project with Appium – utest course )

http://megettingerror.blogspot.com/2015/01/java-code-to-start-appium-server-on-mac.html – start and stop appium server


http://stackoverflow.com/questions/6356340/killing-a-process-using-java kill a service / process




https://discuss.appium.io/t/support-for-automating-multiple-devices-simultaneously/230 – multiple devices

https://github.com/saikrishna321/AppiumAndroidParallelExecution – parallel

https://github.com/saikrishna321/AppiumTestDistribution – parallel 




http://blog.rightqa.com/2015/07/an-introduction-to-appium-architecture.html ( An Introduction to Appium Architecture )

https://www.built.io/blog/2015/03/start-automating-native-ios-testing-with-appium-using-node-js/ ( Start Automating Native iOS testing with Appium using Node.js )

https://help.testobject.com/docs/guides/appium-osx-ios/  ( Appium Teting on Physical iOS devices )

https://help.testobject.com/docs/guides/appium-osx-android/ ( Appium Testing on Physical Android Devices )

http://blog.wedoqa.com/2015/10/setting-up-appium-on-mac-os-x-for-ios-virtual-devices-to-test-your-application/  ( Setting Appium on Mac OS )

https://aaronpresley.com/building-ios-app-use-appium-gui/ (  
Building iOS App simulator only for Use in Appium GUI )

https://wiki.saucelabs.com/display/DOCS/Instant+Appium+Python+iOS+Real+Device+Tests#InstantAppiumPythoniOSRealDeviceTests-BuildingYouriOSAppforRealDeviceTesting ( Building iOS App for Real Device Testing )

http://james-willett.com/category/appium/  ( James Willett – Technical Testing )

Appium + iOS Real device issues ??

iOS UIAutomation to XCUITest Migrationhttps://github.com/appium/appium/blob/master/docs/en/advanced-concepts/migrating-to-xcuitest.md )

Android UIAutomator to UIAutomator 2https://github.com/appium/appium-uiautomator2-server/wiki )

http://executeautomation.com/blog/page-object-model-with-appium/ – Page Object Model With Appium

https://www.youtube.com/embed/wjvAh4yjwtI?feature=oembed – The Mobile JSON Wire Protocol

http://www.testingdiaries.com/appium-android-tutorial/ ( Appium Android Configuration with Eclipse )

http://www.testingdiaries.com/appium-ios-setup-native-apps/ ( Appium iOS Setup )

http://www.testingdiaries.com/mobile-performance-testing-record-script-jmeter/ ( Mobile Performance Testing )

http://www.tabaolan.com/MobileTest/mobile-testing-create-first-appium-webdriver-android-script-in-java/ ( Create First Appium WebDriver Android Script in Java )

https://saucelabs.com/resources/articles/appium-bootcamp-chapter-8 ( Finding Information On Your Own )


https://seleniumframework.wordpress.com/2015/10/15/mobile-continuous-integration/ ( Mobile CI )

Testing iOS App with Appium : Setup Video ( TestObject )

Testing Android App with Appium : Setup Video ( TestObject )

irb – http://www.tutorialspoint.com/ruby/interactive_ruby.htm 

http://rubular.com/ – Ruby Regular Expression Editor


10.  Elements Locator Strategy

>>>  Method 1: ( Appium Desktop Client ) <<<

https://github.com/appium/appium-desktop ( Mac, Windows , Linux )

https://github.com/appium/appium-dot-exe ( Windows Client ) – Deprecated

https://github.com/appium/appium-dot-app  ( Mac Client ) – Deprecated

check setup – click on “Stethoscope – Doctor” button to confirm all is well and then only proceed further

iOS Settings






App Path: The path to the iOS application (.app, .zip, or .ipa) you wish to test.

Choose Button: Used to choose the path to your application.

BundleID: The bundle ID for the application you wish Appium to use (e.g. com.yourCompany.yourApp).

Use Mobile Safari: This will make Appium start the Mobile Safari app instead of using a user-supplied application. BundleID or App Path should both be unchecked when this option is used.

Device Settings

Force Device: This will make Appium force the Simulator to iPhone or iPad mode.

Platform Version: Version of the mobile platform.

Force Orientation: Force the orientation of the Simulator.

UDID: This is the UDID for the mobile device on which you want to run Appium. If this box is checked, Appium will use the attached iOS device. If this field is checked, bundle ID must be supplied and app path should be unchecked.

Show Simulator Log: If checked, the iOS simulator log will be written to the console.

General Settings


Log to File – check this box to log output to a file

Use Colors

Show Timestamps

Use Local Timezone

Android Setting


Make sure to choose correct platform version


Prerequisites ( For Methods 2 & 3 )

http://railsapps.github.io/installrubyonrails-mac.html  ( Install RMV , Ruby ) 

https://discuss.appium.io/t/difference-between-arc-and-irb/1426  ( arc vs irb commands )

Finding Android appActivity and appPackage with help of APK info app


>>>  Method 2: ( Appium Ruby Console ) <<<


( download ebook and refer to below chapters )

https://saucelabs.com/blog/appium-bootcamp-chapter-2-the-console ( appium.txt )

https://saucelabs.com/blog/appium-bootcamp-chapter-3-interrogating-your-app   Interrogating your app



Appium Server Capabilities ( caps.md )

For Android

Appium.txt ( emulator )


automationName = “uiautomator2”
platformName = “Android”
deviceName = “placeholder string”
app = “FULL_PATH_IS_MUST/com.flipkart.android.apk”
avd = “Nexus_4_2”   #android list avd

(?? not sure why full path need to be given, even when both appium.txt and .apk are in same directory )

Appium.txt ( Real Device )


automationName = “uiautomator2”
platformName = “Android”
deviceName = “placeholder string”
app = “FULL_PATH_IS_MUST/com.flipkart.android.apk”

#works with any of the connected Android Devices

For iOS

instruments -s devices

Appium.txt ( Simulator )

automationName = “XCUITest”
#comment 1
platformName = “iOS”
app = “/Users/…/Debug-iphonesimulator/XCodeGeneratedTestApplication.app”
#comment 2
deviceName = “iPhone SE”
platformVersion = “10.2”

Appium.txt ( Real Device )

automationName = “XCUITest”
platformName = “iOS”
xcodeConfigFile = “/Users/vikram-anna/../myconfig.xcconfig”
#app = “/Users/../Debug-iphoneos/XCodeGeneratedTestApplication.app”
app = “/Users/vikram-anna/Workspace/../XCodeGeneratedTestApplication.ipa”
#deviceName random comment
deviceName = “Vikram’s iPhone”
platformVersion = “10.2”
udid = “97d9bb791384407fa67df34c07123455efab09”

Refer to https://github.com/appium/appium/issues/6867


Switching to Mobile Browser Context

Driver created with above method points to native app, if you want to work with mobile browser follow below steps

@selenium_driver = @appium_driver.start_driver

Reference : https://github.com/OuchSaray/wikipedia-appium-ruby/blob/cd7069072b3328037689c02be7bc1aaf5ffc58e2/testcases/simple.rb


>>> Method 3: ( irb ) <<<


Goto Terminal in mac , 

in first tab start appium server and 

in second tab execute below steps in irb session  

2.2.1 :001 > require ‘appium_lib’

2.2.1 :002 > caps = {

caps: {

platformName: “iOS”,

deviceName: “Vikram’s Automation iPhone”,


app: ‘/Users/vikram-anna/Library/Developer/Xcode/DerivedData/wunderlist-ddifxljcmzpfdfgvqrmvjoepiisx/Build/Products/Development-iphoneos/Wunderlist.app’,

newCommandTimeout: ‘9999’


appium_lib: {

server_url: ‘;,

wait: 300



2.2.1 :015 > Appium::Driver.new(caps).start_driver

2.2.1 :016 > Appium.promote_appium_methods Object

…then start using methods as below

page , page_class , @driver.find_element(:name , ‘Sign in’).methods

Helpful Links





>>>  Method 4:  ( Others )  <<<

https://medium.com/@chenchaoyi/the-options-of-inspecting-ios-10-app-with-appium-1-6-534ba166b958#.ni3nhz70t  ( 3 option are mentioned )

Note: Appium Mac Client 1.5.3 

– App Path: /Users/../Xcode/DerivedData/../Build/Products/Debug-iphonesimulator/AppUnderTest.app

( Not working with ipa file created with developer certificate locally ?? )

– Force Device Simulator Name (  instruments -s devices )

– Platform Version Input manually per above command results

–  Start appium server externally

– No need to change any other setting


iOS App Accessibility Inspector


Accessibility Inspector YouTube   https://www.youtube.com/watch?v=4BgkVp0v3BM

Other Info ( TBR )


http://executeautomation.com/blog/locating-elements-in-appium-part-a/ – Locating Elements In Appium

11.  Appium + Selenium Grid / Grid Setup , Parallel Execution

1. http://blog.zymr.com/configuring-appium-node-servers-with-selenium-grid     ( Configuring Appium Node Servers with Selenium Grid )

2. https://www.3pillarglobal.com/insights/parallel-testing-on-multiple-android-devices-using-appium-and-cucumber ( Parallel Testing On Multiple Android Devices Using Appium & Cucumber )

3. https://engineering.naukri.com/2016/04/android-parallel-automation/  ( Jenkins Setup For Parallel Execution )

4. https://essenceoftesting.blogspot.de/2017/02/  ( Jenkins, cucumber-jvm, parallel )

12.  Continuous Integration

https://help.testobject.com/docs/tools/appium/continuous-integration/jenkins-gradle/ ( Running Appium tests through Jenkins using Gradle )


https://testobject.com/blog/2016/06/testobject-appium-setup.html  ( Appium Setup with TestObject )

https://help.testobject.com/docs/tools/appium/setups/ ( Setting up Your Tests )