Execute appium test on android native app in java

appiumtest If you are new to appium, please refer below links for the prerequisites


For the appium test: we will be using Selenium, Appium, Eclipse IDE (java) and Android app (.apk) in an emulator or real handset…

Before running appium test on real device or android emulator, make sure we keep the device connected to computer, use adb command to verify.

Ways to install apps (.apk) on mobile or emulators:

  • Install as usual from android play store.
  • Using command line

Have the required .apk file on computer, and connect mobile to computer in debug mode.
open command prompt, type

For appium test, we will use selendroid sample application… [download selendroid-test-app.apk ‘click on view raw to download’]

Required jar files :

  • selenium related jar files [follow webdriver setup to download]
  • java-client-x.x.x.jar

Let’s understand the above code in details:

Code uses testNG, Java and appium…


We have capabilities setup for the mobile handset or emulator like DeviceName, Platform, version, app activity, app package etc…
Refer Appium capabilities for more information

then, we have instantiated AndroidDriver object which accepts 2 arguments:

  • URL
  • Capability object

Under @Test, whatever the code present is same as selenium test.

Content posted is based on learning or working experience,
Share the post with others if find useful,
Any queries?, leave comments or discuss on our facebook:qavalidation.com, Thanks!

1 Response

  1. June 10, 2016

    […] We have seen how to run appium tests on android native apps […]

Leave a Reply

Your email address will not be published. Required fields are marked *