Desired Capabilities in Appium

Jash Unadkat
2 min readMay 5, 2020

What Are Desired Capabilities in Appium?

Desired Capabilities in Appium refer to the combination of key-value pairs encoded in a JSON object. These key-value pairs are defined by the QAs to request the Appium server for the desired test automation session.

Let’s consider an example of Desired Capabilities in Appium represented as a JSON object.

{
“platformName”: “Android”,
“platformVersion”: “10.0”,
“deviceName”: “Samsung Galaxy Note10”,
“automationName”: “Appium”,
“app”: “path for the app under test”
}

Using the above mentioned Desired Capabilities, the user is instructing the drivers to start the test automation session for the app at the mentioned path on a Samsung Galaxy Note 10 with Android version 10.0 using Appium.

As Appium supports both Android and iOS, it has a unique set of Capabilities for both platforms. Let’s check out a few commonly used capabilities for both the platforms.

Common Capabilities in iOS

udid: Unique identifier of the connected physical device, E.g — 1ae203187fc012g.

safariInitialUrl: Defines the Initial URL to be loaded. The default URL redirects to a local home page, E.g value— https://www.github.com

autoAcceptAlerts: This set to true to Accept all iOS alerts automatically if they pop up. The default value is false.

Common Capabilities in Android

appPackage: It Represents the Java package of the desired Android App to be tested. E.g value — com.example.android.myApp, com.android.settings

browserName: Represents the name of the mobile web browser to be automated. The value should be an empty string if automating an app. E.g — ‘Safari’ for iOS

appActivity : Represents the name of the desired activity to be launched from the package. It needs to be preceded by a ‘.’ E.g — .MainActivity, .Settings

Market trends continue to evolve rapidly. Consequently, teams need to ensure that their apps are ready to cater to users operating on the latest mobile devices. They need to test their mobile apps extensively across a range of devices operating on multiple platforms (Android and iOS).

As configuring the tests with the ideal Desired Capabilities forms the basis of most automated app tests, understanding the basics of Appium Desired Capabilities is of utmost importance. This article aims to assist with fostering that understanding, thus giving devs and QAs the tools they need to craft an ideal customer experience.

--

--

Jash Unadkat

As a tech geek, I love writing articles about everything related to web development or software testing space.