Mobile	web	app	scripts	
execution	on	real	
Android	device	using	
Garima Goel
(Naukri Quality)
Why	Appium?	
Advantages of using appium for mobile site
Test script execution:
•  Different Android devices
•  Different versions of Android OS
•  Reduces manual Effort
•  Reduces Testing time
•  Larger ROI on Automation test scripts
•  Responsive Pages automation
Appium Architecture
On an Android device, Appium uses the UIAutomator framework to automate
the apps.
When we execute the test scripts, Appium sends the command to the
UIAutomator running on the device. Here, bootstrap.jar is used to execute
the test command in order to perform the action on the Android device.
Appium on Android
Additional prerequisites to use
Appium
Apart from current selenium setup, we need to
configure following setup on our machine
Android SDK tools (API>=17)
ADT plugin for Eclipse
Appium server
Appium client libraries
AVD or real device
Appium Server
There are 2 ways to
start the Appium
server:
• Using command prompt -
Type command: “appium &” to
start the server.
• Using Appium GUI - Click
“Launch Appium Server”
button in the appium GUI to
start the server
Before server Start
After server Start
Setup to be done on mobile device before
start working with Appium
Mobile web app
test script
execution on
real device
We will now study how to
execute selenium test
scripts in native chrome
browser of real android
device.
Code to initialize Android Chrome
browser
Following steps
are to be followed
to execute the
mobile site test
scripts on real
android device
•  Enable USB debugging option in the
android device
•  Connect the device to the laptop and type
“adb devices” in the command prompt to
check device is connected.
•  Start the Appium server.
•  Run the project using ant/maven
command.
•  The test scripts will start executing in the
Chrome browser of the connected mobile
device.
Issues faced
while test script
execution in
Chrome
ElementNotClickableException
InvalidSelectorException
Slow Window Switching
No support for Actions class
Use JavaScript or
sendkeys(Keys.Enter) to click
the element in chrome
browser
Use Explicit Wait / Webdriver
Wait to avoid
InvalidSelectorException
Use Thread.sleep() after
switching to window.
[@NaukriEngineering] Mobile Web app scripts execution using Appium

[@NaukriEngineering] Mobile Web app scripts execution using Appium

  • 1.
  • 2.
    Why Appium? Advantages of usingappium for mobile site Test script execution: •  Different Android devices •  Different versions of Android OS •  Reduces manual Effort •  Reduces Testing time •  Larger ROI on Automation test scripts •  Responsive Pages automation
  • 3.
  • 4.
    On an Androiddevice, Appium uses the UIAutomator framework to automate the apps. When we execute the test scripts, Appium sends the command to the UIAutomator running on the device. Here, bootstrap.jar is used to execute the test command in order to perform the action on the Android device. Appium on Android
  • 5.
  • 6.
    Apart from currentselenium setup, we need to configure following setup on our machine Android SDK tools (API>=17) ADT plugin for Eclipse Appium server Appium client libraries AVD or real device
  • 7.
    Appium Server There are2 ways to start the Appium server: • Using command prompt - Type command: “appium &” to start the server. • Using Appium GUI - Click “Launch Appium Server” button in the appium GUI to start the server Before server Start After server Start
  • 8.
    Setup to bedone on mobile device before start working with Appium
  • 9.
    Mobile web app testscript execution on real device We will now study how to execute selenium test scripts in native chrome browser of real android device.
  • 10.
    Code to initializeAndroid Chrome browser
  • 11.
    Following steps are tobe followed to execute the mobile site test scripts on real android device •  Enable USB debugging option in the android device •  Connect the device to the laptop and type “adb devices” in the command prompt to check device is connected. •  Start the Appium server. •  Run the project using ant/maven command. •  The test scripts will start executing in the Chrome browser of the connected mobile device.
  • 12.
    Issues faced while testscript execution in Chrome ElementNotClickableException InvalidSelectorException Slow Window Switching No support for Actions class
  • 13.
    Use JavaScript or sendkeys(Keys.Enter)to click the element in chrome browser Use Explicit Wait / Webdriver Wait to avoid InvalidSelectorException Use Thread.sleep() after switching to window.