What is Desired Capablities
******************************
* Desired Capabilities is a way of informing to Appium Server which kind of connection it is requesting
.
* It's a hash of Key & Value
* It gives more control on the server during automation.
So some of the key info which we will be using are :
> automationName
> App Name
> Activities Name
> Android App Platform Name
> Android OS Version
Desired capabilities is a JSON object (keys and values pair).
The capabilities keys are case sensitive.
You need to follow correct syntax to set key and value. Without setting these capabilities, you can’t even begin a session or appium connection.
______________
Example
______________
> appActivity: This is to set the Android activity that you want to launch from your package. You need to set ‘appActivity’ as key and ‘com.android.contacts’ as value.
caps.setCapability(“appActivity”, “com.android.calculator2.Calculator”);
appPackage: This capability is for the Java package of the Android app that you want to run. You need to set ‘appPackage’ as key and your package name as value.
caps.setCapability(“appPackage”, “com.android.calculator2”);
appWaitActivity: This is to wait for the activity you’d like to use
caps.setCapability(“appWaitActivity”,”com.android.calculator2.Calculator”);
appWaitPackage: Similar to appWaitActivity, this capability will wait until if finds the desired package
caps.setCapability(“appWaitPackage”,”com.example.android.myApp”);
autoLaunch: This capability is used to install and launch the app automatically. The default value is set to true. We need to set ‘autoLaunch’ as key and value as ‘false’
caps.setCapability(“autoLaunch”,”false”);
automationName: This capability is used to define the automation engine. Here we need to set ‘automationName’ as key and your desired engine (Appium, Selendroid) as value
caps.setCapability(“automationName”,”Selendroid”);
autoWebview: If you are automating hybrid apps and want to move directly into the Webview context, then you can set it by using this capability; the default value is false. You need to set ‘autoWebview’ as key and ‘true’ as value”
caps.setCapability(“autoWebview”, “true”);
This comment has been removed by the author.
ReplyDeleteThat is very Helpful.Thanks
ReplyDeletePost a Comment