Appium Desired Capabilities
Desired capabilities is a JSON object made up of keys and values.
To give a simple example:
{ "platformName": "iOS", "platformVersion": "11.0", "deviceName": "iPhone 7", "automationName": "XCUITest", "app": "/path/to/my.app"}
Basic parameters
Parameters |
Description |
Example |
automationName |
Automated test engine |
Appium OrSelendroid |
platformName |
Mobile operating System |
iOS , Android , orFirefoxOS |
platformVersion |
Mobile OS Version |
such as: 7.1 , 4.4 ; iOS9.0 |
deviceName |
Phone or emulator device name |
Android Ignore, iOS asiPhone Simulator |
app |
.ipa .apk file path |
such as /abs/path/to/my.apk orhttp://myapp.com/app.ipa |
browserName |
Start your phone browser |
iOS such as: Safari,Android Chrome,Chromium,Browser |
newCommandTimeout |
Sets the command time-out, in seconds. |
Like what60 |
autoLaunch |
Appium whether the app needs to be installed and started automatically. Default valuetrue |
true ,false |
language |
(sim/emu-only) Sets the language of the simulator (Simulator/emulator). |
Such as:fr |
locale |
(sim/emu-only) Sets the locale of the simulator (Simulator/emulator). |
Such as:fr_CA |
udid |
Unique Device ID for iOS real machine |
Such as:1ae203187fc012g |
orientation |
Set up a horizontal or vertical screen |
LANDSCAPE (landscape) or PORTRAIT (portrait) |
autoWebview |
Translates directly to the WebView context. Default Value false , |
true ,false |
noReset |
Do not reset the app state before the session. The default value false . |
true ,false |
fullReset |
(IOS) To delete the entire emulator directory. (Android) by uninstalling default valuesfalse |
true ,false |
Android specific
Key Words |
Description |
Example |
appActivity |
Start App package, General point start |
such as: .MainActivity ,.Settings |
appPackage |
Package name for Android app |
Like whatcom.example.android.myApp |
appWaitActivity |
Activity name waiting to start |
SplashActivity |
deviceReadyTimeout |
Setting the time-out period |
5 |
androidCoverage |
The instrumentation class for performing tests |
com.my.Pkg/com.my.Pkg.instrumentation.MyInstrumentation |
enablePerformanceLogging |
(Chrome and WebView only) turn on Chromedriver Performance Logs. (Default false ) |
true ,false |
androidDeviceReadyTimeout |
Wait for the device to time out after starting the app, in seconds |
Such as30 |
androidDeviceSocket |
The socket name of the development tool. Chromedriver it as a developer tool to connect. |
Such aschrome_devtools_remote |
avd |
The name of the AVD (Android emulator device) that needs to be started. |
Such asapi19 |
avdLaunchTimeout |
The time-out in milliseconds to wait for the AVD to start and connect to the ADB. (Default value 120000 ) |
300000 |
avdReadyTimeout |
The time-out in milliseconds to wait for the AVD to finish starting the animation. (Default value 120000 ) |
300000 |
avdArgs |
Additional parameters that need to be added when starting the AVD. |
Such as-netfast |
useKeystore |
Use a custom KeyStore to re-sign the APK. Default valuefalse |
true Orfalse |
keystorePath |
Custom KeyStore path. Default ~/.android/debug.keystore |
Such as/path/to.keystore |
keystorePassword |
Customize the password for the KeyStore. |
Such asfoo |
keyAlias |
Alias for Key |
Such asandroiddebugkey |
keyPassword |
Key's password |
Such asfoo |
chromedriverExecutable |
Webdriver the absolute path of the executable file should be used instead of the Appium webdriver) |
/abs/path/to/webdriver |
autoWebviewTimeout |
The time in milliseconds that the webview context is activated. Default2000 |
Such as4 |
intentAction |
The intent action used to start the activity. (Default value android.intent.action.MAIN ) |
such as android.intent.action.MAIN ,android.intent.action.VIEW |
intentCategory |
The intent category used to initiate activity. (Default value android.intent.category.LAUNCHER ) |
such as android.intent.category.LAUNCHER ,android.intent.category.APP_CONTACTS |
intentFlags |
Flags (default) for initiating activity 0x10200000 |
Such as0x10200000 |
optionalIntentArguments |
The additional intent parameter used to initiate activity. Please see the Intent parameter |
such as --esn <EXTRA_KEY> ,--ez <EXTRA_KEY> <EXTRA_BOOLEAN_VALUE> |
dontStopAppOnReset |
Do not stop the process that is being tested when you start an app with ADB. Default value:false |
true Orfalse |
unicodeKeyboard |
Use the Unicode input method. Default valuefalse |
true Orfalse |
resetKeyboard |
Reset Input method to the original state, default valuefalse |
true Orfalse |
noSign |
Skip the steps to check and debug your app. Default valuefalse |
true Orfalse |
ignoreUnimportantViews |
Calling the Uiautomator function will speed up the test execution. Default valuefalse |
true Orfalse |
disableAndroidWatchers |
Turn off Android monitoring app without sounding ANR and crash crash monitor default: false . |
true Orfalse |
chromeOptions |
Allows incoming chrome driver to use the Chromeoptions parameter. Please refer to chromeoptions for more information. |
chromeOptions: {args: [‘--disable-popup-blocking‘]} |
iOS-specific
Key Words |
Description |
Example |
calendarFormat |
(sim-only) to set the calendar format for the iOS simulator |
such as gregorian (Gregorian) |
bundleId |
The bundle ID of the application being tested, when the test is performed on the real machine, you can not provide app the keyword, but you must provide UDID |
Such asio.appium.TestApp |
udid |
Unique device number for connecting to the real machine (unique devices identifier) |
Such as1ae203187fc012g |
launchTimeout |
In milliseconds, set a time to wait for instruments before the Appium run fails |
Like what:20000 |
locationServicesEnabled |
(sim-only) forces the location service to be turned on or off. The default value is to keep the current emulator set |
true Orfalse |
locationServicesAuthorized |
When using this keyword, you also need to use the keyword bundleId to send the bundle ID of your app. |
true Orfalse |
autoAcceptAlerts |
Automatically select accept when an IOS personal information access warning (such as location, contact, picture) appears. The default value false . |
true Orfalse |
autoDismissAlerts |
When an IOS personal information access warning (such as location, contact, picture) appears, automatic selection is not accepted (Dismiss). The default value false . |
true Orfalse |
nativeInstrumentsLib |
Use native intruments libraries (that is, close instruments-without-delay) |
true Orfalse |
nativeWebTap |
(sim-only) Allow "real" in Safari, default value: false . Note: Depending on the viewport size/scale, the Click action does not necessarily pinpoint the corresponding element in the location. |
true Orfalse |
safariInitialUrl |
(sim-only) (>= 8.1) The initial address of Safari. The default value is a local welcome page |
For example:https://www.github.com |
safariAllowPopups |
(Sim-only) allows JavaScript to create new windows in Safari. The default is to keep the emulator current settings. |
true Orfalse |
safariIgnoreFraudWarning |
(sim-only) prevents Safari from displaying a warning that this site may be at risk. The browser's current settings are maintained by default. |
true Orfalse |
safariOpenLinksInBackground |
(sim-only) Whether Safari allows links to open in a new window. The browser's current settings are maintained by default. |
true Orfalse |
keepKeyChains |
(sim-only) Whether to keep the password store record (keychains) when Appium session starts/ends (library/keychain (keychains)) |
true Orfalse |
localizableStringsDir |
Where to find the localized string. Default valueen.lproj |
en.lproj |
processArguments |
Parameters passed to the AUT via instruments |
Such as-myflag |
interKeyDelay |
In milliseconds, the delay between each key is pressed. |
Such as100 |
showIOSLog |
Whether the log of the device is displayed in the Appium log. Default valuefalse |
true Orfalse |
sendKeyStrategy |
Enter a text-to-text box policy. Simulator Default value: oneByOne (one after the other). Real Device defaults: grouped (grouped input) |
oneByOne , grouped orsetValue |
screenshotWaitTimeout |
The maximum wait time in seconds for the screen to be generated. Default value: 10. |
Such as5 |
waitForAppScript |
The IOS automation script code that determines whether the app is started. By default, the system waits until the page content is not empty. The result must be a Boolean type. |
For example, true; target.elements().length > 0; $.delay(5000); true; |
IOS only, using Xcuitest
(For xcuitest-specific capabilities, please refer to the documentation on the Xcuitest Driver repo itself.)
YOU.I Engine only
(for you.i engine-specific capabilities, please refer to the documentation on the YOU.I Engine driver itself.)
Official Document: HTTPS://GITHUB.COM/APPIUM/APPIUM/BLOB/MASTER/DOCS/EN/WRITING-RUNNING-APPIUM/CAPS.MD
Appium+python Automation 21-desiredcapabilities detailed "reprint"