Desired Capabilities

Desired Capabilities are the key and value pairs that are sent to the appium server by client libraries in the form of JSON objects. This will help to build the driver object with all the required data for a test device.

Look at the below desired capabilities which are sent to the appium server by python client which are written in the dictionary variable.

While executing, the python client sent those data in the form of JSON object to Appium Server.

Below are some important DesiredCapabilities which need to be determined while writing the script.

desired_caps = {}
desired_caps['platformName'] = 'Android'
desired_caps['automationName'] = 'UiAutomator2'
desired_caps['platformVersion'] = '10'
desired_caps['deviceName'] = 'Pixel3XL'
desired_caps['app'] = ('/Skill2Lead/Appium_Demo_App/Android/Android_Appium_Demo.apk')
desired_caps['appPackage'] = 'com.skill2lead.appiumdemo'
desired_caps['appActivity'] = 'com.skill2lead.appiumdemo.MainActivity'

First we need to create a python empty dictionary object as

desired_caps = {}

Now we need to add the keys and values to the dictionary object.

Here all keys are predefined which are passed to the dictionary object.