Desired capabilities
Desired capabilities is a collection of key-value pairs sent to the Appium server (such as a map or hash) that tells the server what type of automation session we want to start. There are also various capabilities that can modify the behavior of the server while automating the runtime. For example, we can platformName set capability to iOS tell Appium that we want an IOS session instead of an Android or a Windows session. We can also set safariAllowPopups capability to true make sure we can use JavaScript to open a new window in a Safari automation session.
Setup methods such as:
classYY (unittest. TestCase):defsetUp (self): Desired_caps= { 'PlatformName':'Android', 'devicename':'611AKBPP22HR5',#device name found by ADB devices 'platformversion':'4.4.2', 'Apppackage':'Com.duowan.mobile',#package name of the app under test 'appactivity':'com.yy.mobile.ui.splash.SplashActivity',#Activity at startup #' app ':P ath (' E:\yymobile_client-7.7.1.apk ')} self.driver= Webdriver. Remote ('Http://localhost:4723/wd/hub', Desired_caps)
Common parameters such as:
PlatformName: Using the mobile operating system,, iOS Android , orFirefoxOS
DeviceName: Type of phone or simulator used
App: An installation package that the local absolute path _ or _ remote HTTP URL points to, Appium installs it on the appropriate device. Note that if you specify the appPackage and appActivity parameters, Android does not need this parameter.
Apppackage: The package name of the running Android app
Appactivity:activity's name refers to the Android acticity you want to launch from your package.
Appwaitactivity: Android Activity name for waiting to start
Androidinstalltimeout: The amount of time (in milliseconds) spent waiting to install the APK in the device. The default value is90000
Unicodekeyboard: Use Unicode Input method. The default value isfalse
Resetkeyboard: unicodeKeyboard after the Unicode test with the keyword is set, reset the input method to its original state. If used alone, it will be ignored. The default value isfalse
Chromeoptions: A parameter that allows chromeoptions to be passed to Chromedriver. For more information, please refer to Chromeoptions
Nativewebscreenshot: In the context of the Web, use native (native) methods instead of using proxy chromedriver. The default value isfalse
Androidscreenshotpath: The directory name that is saved in the device. The default value is/data/local/tmp
Autograntpermissions: Let Appium automatically determine what permissions your app needs and grant it to the app when it's installed. The default setting isfalse
Example: Solve Send_keys () when sending Chinese, cannot input the question:
Set Unicodekeyboard=true,resetkeyboard=true
For more information, please read the official instructions http://appium.io/docs/cn/writing-running-appium/caps/index.html
Appium Automation Test (6) Appium server initialization parameter settings