Desired capabilities must be provided at the start of the session.
Desired capabilities is essentially an object of key value, and it tells Appium server something like:
- Does this test start a browser or start a mobile device?
- Start Andorid or start iOS?
- What is the app's package when you start Android?
- What is the activity of the app when you start Android?
The copyright of this article is owned by ethanol, welcome reprint, but please specify the author and source, strictly prohibited for any commercial use
Appium desired capabilities is an extension of the desired capabilities of webdriver, 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 following properties are specific to the Android platform:
- 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.
This article focuses on the Appium testing methods and techniques of the Android platform, so there are no iOS device-specific properties listed here.
For more information, please refer to the official documentation
Here we find that * * We often have to get the app's package and activity name, * * So what tools can make it easy for us to get this information? The next section is about answering this question.
The copyright of this article is owned by ethanol, welcome reprint, but please specify the author and source, strictly prohibited for any commercial use
Appium Tutorial--desired capabilities details (go from Testerhome)