Desired Capabilities are keys and values encoded in a JSON object, sent by Appium clients to the server when a new automation sessionis requested.
They tell the Appium drivers all kinds of important things abouthow you want your test to work.
Each Appium client builds capabilities in a wayspecific to the client‘s language, but at the end of the day, they are sent over to Appium as JSON objects.
There are many, many Capabilities that Appium supports.Capabilities also differ by driver, though there are a standard set that mostdrivers pay attention to.
What follows are a series of tables outlining thevarious Desired Capabilities available in general and for specific drivers.
===========================================================
General Capabilities
These Capabilities span multiple drivers.
automationName Which automation engine to use Appium (default) or Selendroid or UiAutomator2 or Espresso for Android or XCUITest for iOS or YouiEngine for application built with You.i Engine |
||
platformName Which mobile OS platform to use iOS, Android, or FirefoxOS |
||
platformVersion Mobile OS version e.g., 7.1, 4.4 |
||
deviceName The kind of mobile device or emulator to use iPhone Simulator, iPad Simulator, iPhone Retina 4-inch, Android Emulator, Galaxy S4, etc.... On iOS, this should be one of the valid devices returned by instruments with instruments -s devices. On Android this capability is currently ignored, though it remains required. |
||
app The absolute local path or remote http URL to a .ipa file (IOS), .app folder (IOS Simulator), .apk file (Android) or .apks file (Android App Bundle), or a .zip file containing one of these (for .app, the .app folder must be the root of the zip file). Appium will attempt to install this app binary on the appropriate device first. Note that this capability is not required for Android if you specify appPackage and appActivity capabilities (see below). Incompatible with browserName. See here about .apks file. /abs/path/to/my.apk or http://myapp.com/app.ipa |
||
browserName Name of mobile web browser to automate. Should be an empty string if automating an app instead. ‘Safari‘ for iOS and ‘Chrome‘, ‘Chromium‘, or ‘Browser‘ for Android |
||
newCommandTimeout How long (in seconds) Appium will wait for a new command from the client before assuming the client quit and ending the session e.g. 60 |
||
language Language to set for iOS and Android. It is only available for simulator on iOS e.g. fr |
||
locale Locale to set for iOS and Android. It is only available for simulator on iOS. fr_CA format for iOS. CA format (country name abbreviation) for Android e.g. fr_CA, CA |
||
udid Unique device identifier of the connected physical device e.g. 1ae203187fc012g |
||
orientation (Sim/Emu-only) start in a certain orientation LANDSCAPE or PORTRAIT |
||
autoWebview Move directly into Webview context. Default false true, false |
||
noReset Don‘t reset app state before this session. See here for more details true, false |
||
fullReset Perform a complete reset. See here for more details true, false |
||
eventTimings Enable or disable the reporting of the timings for various Appium-internal events (e.g., the start and end of each command, etc.). Defaults to false. To enable, use true. The timings are then reported as events property on response to querying the current session. See the event timing docs for the the structure of this response. e.g., true |
||
enablePerformanceLogging (Web and webview only) Enable Chromedriver‘s (on Android) or Safari‘s (on iOS) performance logging (default false) true, false |
||
printPageSourceOnFindFailure When a find operation fails, print the current page source. Defaults to false. e.g., true |
原文地址:https://www.cnblogs.com/davieyang/p/10066911.html