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 uses JSON wire protocol internally to interact with Android and iOS native apps using the Selenium WebDriver.
Connect Android Phone to Windows OS system via USB cable and enable “Developer options” by navigating to Settings/About Phone and tapping build number seven times.You will get a notification saying that you’re now a developer.
Once you are a developer you need to navigate to “Developer options” and enable the USB debugging option.
On Android phone, install “Application Reader” app from Google play store. Application Reader app is used get the app Package and Activity details, which is used for testing the application.
Now open command prompt, navigate to Android SDK tools path and run the command to open Uiautomatorviewer.
To capture a screen, click the “Device Screenshot button” in the uiautomatorviewer tool. The screenshot of the page in your device is captured. You can move over the snapshot in the left-hand panel to see the UI components identified by the uiautomatorviewer.
Start the Appium application by double clicking the .exe file.
Sample Appium Program:
Here is the sample Appium program using Python to get temperature of location using “Weather” app. We need to install weather app before running this code.
Selenium automates web browsers.There are other tools which can be used to automate both web applications and windows applications like QTP (Quick Test Professional). As every one aware that QTP is Licensed Tool where as Selenium is Open source tool, download it configure it and enjoy.
In 2005, Selenium first came up with record and play back option known as Selenium IDE. It only comes with Firefox plugin.
It is the second version of Selenium, where user sends commands to proxy server and then pass data to browser.
Supports all web browsers unlike Selenium IDE.
Supports multiple OS.
Cannot support Android OS & iOS.
Doesn’t support rich API.
Need to start proxy server.
Cannot talk directly to browser. Instead, proxy server takes commands from user and pass it to browser.
It is the latest version of Selenium, where it directly talks to browser.Unlike Selenium RC, it doesn’t use any proxy server. It was developed in 2009.
Handle Mouse movements.
Support for Android OS and iOS unlike Selenium RC.
Can handle rich API.
Support multiple browsers.
Supports all the latest versions of Firefox.
Limitation in Browser Support.
There is no support for running tests in parallel on a single computer.
Selenium with Python bindings:
In this blog, we will talk on Selenium with Python bindings.
Let’s start by installing Python2.7. Please follow below link to install Python2.7 and Eclipse editor for creating python project.
Python is a general-purpose interpreted, interactive, object-oriented, and high-level programming language. It was created by Guido van Rossum during 1985- 1990.Python can be easy to pick up whether you’re a first time programmer or you’re experienced with other languages.Python is developed under an OSI-approved open source license, making it freely usable and distributable, even for commercial use.
Advantages of Python over other languages:
Python is a Beginner’s Language. Its code is easy to read and you can do a lot of things just by looking at it.
You can execute a lot of complex functionalities with ease, thanks to the standard library.
Python supports Object-Oriented style.
Supports multiple systems and platforms.
You can actually sit at a Python prompt and interact with the interpreter directly to write your programs.
You can build GUI applications easily.
Current Stable Versions:
For Python2.7 -> 2.7.13
For Python3 -> 3.6.1
Most of the code will be written in Python2.7 as it supports large number of libraries.
How to download Python2.7 ?
Please use below link to download Python2.7 and download Python2.7.13 or above version.