Appium Desired Capabilities-General Capabilities

本文详细介绍了Appium自动化测试中使用的能力参数,包括通用能力和特定驱动能力,如automationName、platformName、platformVersion等,这些参数决定了测试的运行方式和环境。

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

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值