Brief introduction
Desired capabilities is a collection of some key-value pairs. Python uses a dictionary approach.
The client sends these key-value pairs to the server and tells the server how we want to test them. For example, we can set PlatformName's capability to Android, which is to tell the Appium server that we want an Android session instead of an IOS one.
Before we create a new driver, we will define the Desired_caps first.
APP desired_caps Definition
For example, the following code:
Desired_caps ={}desired_caps['PlatformName'] ='Android'desired_caps['platformversion'] ='4.2.2'desired_caps['devicename'] ='Android Emulator'desired_caps['Apppackage'] ='com.android.contacts'desired_caps['appactivity'] ='com.android.contacts.activities.PeopleActivity'
This is a typical way to test Android apps.
We use a dictionary to install key-value pairs. This defines the platform on which we want to run test cases, that is, Android. Defines the platform version, which is Android 4.2.2. Defines the app's package name and activity name.
The package and Activity are specified here, so you don't have to specify the app.
Desired capabilities Key value pair detailed description
Reference: Http://appium.io/slate/en/master/?python#appium-server-capabilities
Common desired capabilities Key-value pairs:
Android-specific desired capabilities key-value pairs:
Appium Python Three: desired capabilities