To write Appium scripts, you must configure desired capabilities information
Desired capabilities must be provided at the start of the session.
Desired capabilities is essentially stored in the form of the key value dictionary, which the client sends to the server and tells the server how we want to test it. It tells Appium server something like:
-
-
Whether to 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?
Appium's desired capabilities basic configuration is as follows:
# Initialization Information
Desired_caps = {}
desired_caps["PlatformName"] = "Android"
desired_caps["platformversion"] = "7.0"
desired_caps["devicename"] = "HuaWeiP9"
desired_caps["apppackage"] = "app Package name"
desired_caps["appactivity"] = "Activitys Name of App"
# Support Input Chinese
desired_caps["Unicodekeyboard"] = "True"
desired_caps["Resetkeyboard"] = "True"
Configuration Description:
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 ...
-
Automationname: What kind of automation engine is used. Appium (default) or Selendroid.
-
PlatformName: which mobile platform to use. IOS, Android, Orfirefoxos.
-
Platformversion: Specifies the system version of the platform. For example, the Android platform, version 5.1.
-
Appactivity: The activity name of the app to be tested. such as 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.
Appium Desired Capabilities Information configuration