Step by Step Mobile App Testing with Appium in Python

Reading Time: 2 minutes

Appium is an open source test automation framework that can be used to test native, hybrid and mobile web apps.
It uses Web-Driver protocol to test iOS and Android apps.Downloads:


  • Of course basics of Python.
  • You must have following environment variables  set on your windows machine.
    1. JAVA_HOME – C:\\Program FilesJavajdk1.8.0_25
    2. ANDROID_HOME – D:\\Android_Developmentandroid_sdk
    3. ANT_HOME –  C:apache-ant-1.9.4
    4. PATH – C:\\WindowsSystem32;D:Android_Developmentandroid_sdkplatform-                                                    tools;%JAVA_HOME%bin;D:Android_Developmentandroid_sdktools;%ANT_HOME%bin;
  • Android device with USB Debugging is ‘ON’.
  • Python Appium Client – You can install it using pip using below mentioned command in ‘CMD’

    [code] pip install Appium-Python-Client [/code]

Assuming that you have already installed required software and Python library on your machine.

Configuring Appium and inspect our Demo App for resources

Step 1:
From source code extract the files and put the ‘MyApplication.apk’ file somewhere in one folder.
(Note : You can use your own APK)

Step 2:
Run Appium.exe and go to first tab(Android icon) and browse the file , Appium will automaticaly pull the package info, Launch Activity etc. details

Start the Appium server by Clicking the Play icon and Click on the “Search icon” button to inspect the resource for path,id,name etc. As you can see I have a resource ID of the refresh button of my Demo App. Copy that ID we need it for future.

Step 4:
It will install the APK to the device and Now you can see the Appium inspector to see the Resource IDs and other information in details tab.

Step 5 :
If you click on the “android.widget.ImageButton[384,755][480,854]” . In the details section you can see its resource ID: “com.witmergers.getstatus:id/fab” .

Step 6:
Now open Pycharm and write code in python to open the Application and Click on the Image Button(Refresh Button).

dsadStep 7:
Run the python file in PyCharm. If all goes well you will see the Application will open in you device and Refresh Button will be clicked followed by Closing of the Application.

In the Pycharm Output window you will see the “Test Passed” with Ok

Now start developing more Test cases and keep testing Apps.

4 thoughts on “Step by Step Mobile App Testing with Appium in Python”

  1. Can you please give me an idea about how much API support is available if Appium-python is used in comparison to Appium-Java ?

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.