...

/

Example - Android App and Mobile Web Automation

Example - Android App and Mobile Web Automation

Get introduced to capabilities for testing android apps and mobile web on android phones.

What are capabilities?

Capabilities or DesiredCapabilities are simple key-value pairs encoded as JSON objects. These capabilities are sent by the client to the server, which could be a ChromeDriver service, GeckoDriver service, EdgeDriver service, or AppiumDriver service, to tell the server how the test should work and what features or capabilities to enable.

Every driver will have their own set of capabilities.

The following is a sample DesiredCapabilities JSON that the client requests from the Appium service for creating an AndroidDriver to test mobile web browsers.

{
  "browserName": "Chrome",
  "platformName": "Android",
  "deviceName": "Emulator",
  "udid": "emulator-5554",
  "automationName": "UIAutomator2"
}

We can search for the capabilities at https://caps.cloudgrey.io.

Capabilities for Android app automation

The following table shows the capabilities with respect to automating Android applications:

Capability Name Description Possible Values
automationName automation engine to use UiAutomator2
platformName mobile OS platform to use Android
platformVersion mobile OS version 7.1, 4.4, etc.
deviceName kind of mobile device or emulator to use Android Emulator, Galaxy S4, etc…
app absolute path of an .apk file or a .zip file that contains the .apk file
...