Desired capabilities at the start of the session is necessary to provide, first look at the following code:
Desired capabilities is essentially an object of key value, and he tells Appium server something like:
1. When the test starts the browser or mobile device;
2. is Android or iOS enabled;
3. What is the app's package when you start Android?
4. What is the activity of the app when you start Android?
aPpium desired capabilities is an extension of the webdriver desired capabilities, some of the following common configurations are required:
Automationname: What kind of automation engine is used. Appium (default) or Selendroid?
PlatformName: which mobile platform to use. IOS, Android, Orfirefoxos?
DeviceName: Which device is started, is it a real machine or an emulator? iphone Simulator, IPad Simulator, iphone Retina 4-inch, Android Emulator, Galaxy S4, etc ...
App: Absolute path of application, note must be absolute path. If you specify Apppackage and Appactivity, this property is not set. In addition, this property and the Browsername attribute are conflicting.
Browsername: The name of the mobile browser. such as Safari ' for IOS and ' Chrome ', ' Chromium ', or ' Browser ' for Android, and app properties are mutually exclusive.
UDID: The ID of the physical machine. Like 1ae203187fc012g.
The properties specific to the Android platform are:
Appactivity: The activity name of the app to be tested. Like Mainactivity,. Settings. Note that the native app should add a "." Before the activity.
Apppackage: The Java package for the app to be tested. Like Com.example.android.myApp, Com.android.settings.
Unicodekeyboard: Whether to use Unicode keyboard input, if set to true, then you can enter Chinese and special characters, this is very common, generally set to true;
Caps.setcapability ("Unicodekeyboard", "true");
Resetkeyboard: Whether to reset the keyboard to the original state, such as you set the keyboard in order to the Unicode keyboard, when the use case is completed, the Resetkeyboard is set to True, the keyboard is reset to the original state;
Caps.setcapability ("Resetkeyboard", "true");
Appium basic FOUR: desired capabilities detailed talk