Appium Capabilities

Momentum Suite M-Live supports the latest WebDriver W3C Protocol for Appium tests. Desired Capabilities can be scripted in the WebDriver test or set within the Appium Inspector.

JavaNodeJSPythonC#RubyPHPPerl
// Use Java Client v6.0.0 or above
DesiredCapabilities capabilities = new DesiredCapabilities();
HashMap<String, Object> momentumOptions = new HashMap<String, Object>();
momentumOptions.put("user", "momentumUser");
momentumOptions.put("token", "momentumToken");
momentumOptions.put("gw", momentumDeviceId);
capabilities.setCapability("momentum:options", momentumOptions);
capabilities.setCapability("appium:platformName", "Android");
capabilities.setCapability("appium:automationName", "UIAutomator2");
capabilities.setCapability("appium:language", "en");
capabilities.setCapability("appium:locale", "en");
capabilities.setCapability("appium:deviceName", "");
capabilities.setCapability("appium:udid", "");
capabilities.setCapability("appium:app", "ms://momentumAppId");
capabilities.setCapability("appium:fullReset", true);
capabilities.setCapability("appium:noReset", false);
// Use Node(WebDriverIO) client v6 and above
var capabilities = {
'momentum:options' : {
"user" : "momentumUser",
"token" : "momentumToken",
"gw" : momentumDeviceId,
},
"platformName" : "android",
"appium:automationName" : "UIAutomator2",
"appium:language" : "en",
"appium:locale" : "en",
"appium:deviceName" : "",
"appium:udid" : "",
"appium:app" : "ms://momentumAppId",
"appium:fullReset" : true,
"appium:noReset" : false,
}
# Use Appium-Python-Client v0.27 or above
desired_cap = {
'momentum:options' : {
"user" : "momentumUser",
"token" : "momentumToken",
"gw" : momentumDeviceId,
},
"platformName" : "android",
"appium:automationName" : "UIAutomator2",
"appium:language" : "en",
"appium:locale" : "en",
"appium:deviceName" : "",
"appium:udid" : "",
"appium:app" : "ms://momentumAppId",
"appium:fullReset" : true,
"appium:noReset" : false,
}
// Use dot net bindings v4.0.0 or above
AppiumOptions capabilities = new AppiumOptions();
Dictionary<string, object> momentumOptions = new Dictionary<string, object>();
momentumOptions.Add("user", "momentumUser");
momentumOptions.Add("token", "momentumToken");
momentumOptions.Add("gw", momentumDeviceId);

capabilities.AddAdditionalCapability("momentum:options", momentumOptions);
capabilities.AddAdditionalCapability("platformName", "android");
capabilities.AddAdditionalCapability("appium:automationName", "UIAutomator2");
capabilities.AddAdditionalCapability("appium:language", "en");
capabilities.AddAdditionalCapability("appium:locale", "en");
capabilities.AddAdditionalCapability("appium:deviceName", "");
capabilities.AddAdditionalCapability("appium:udid", "");
capabilities.AddAdditionalCapability("appium:app", "ms://momentumAppId");
capabilities.AddAdditionalCapability("appium:fullReset", true);
capabilities.AddAdditionalCapability("appium:noReset", false);
# Use Ruby Client version v9.8.1 or above
capabilities = {
'momentum:options' => {
"user" => "momentumUser",
"token" => "momentumToken",
"gw" => momentumDeviceId,
},
"platformName" => "android",
"appium:automationName" => "UIAutomator2",
"appium:language" => "en",
"appium:locale" => "en",
"appium:deviceName" => "",
"appium:udid" => "",
"appium:app" => "ms://momentumAppId",
"appium:fullReset" => "true",
"appium:noReset" => "false",
}
$caps = array(
'momentum:options' => array(
"user" => "momentumUser",
"token" => "momentumToken",
"gw" => "momentumDeviceId",
),
"platformName" => "android",
"appium:automationName" => "UIAutomator2",
"appium:language" => "en",
"appium:locale" => "en",
"appium:deviceName" => "",
"appium:udid" => "",
"appium:app" => "ms://momentumAppId",
"appium:fullReset" => "true",
"appium:noReset" => "false",
)
my $extraCaps = {
	'momentum:options' => {
		"user" => "momentumUser",
		"token" => "momentumToken",
		"gw" => "momentumDeviceId",
	},
	"platformName" => "android",
	"appium:automationName" => "UIAutomator2",
	"appium:language" => "en",
	"appium:locale" => "en",
	"appium:deviceName" => "",
	"appium:udid" => "",
	"appium:app" => "ms://momentumAppId",
	"appium:fullReset" => "true",
	"appium:noReset" => "false",
}

Here is the full list of Appium Desired Capabilities.

List of client libraries with Appium server support

Language/FrameworkGithub Repo and Installation Instructions
Rubyhttps://github.com/appium/ruby_libhttps://github.com/appium/ruby_lib_core
Pythonhttps://github.com/appium/python-client
Javahttps://github.com/appium/java-client
C# (.NET)https://github.com/appium/appium-dotnet-driver
JavaScript (Node.js)https://github.com/webdriverio/webdriverio
RobotFrameworkhttps://github.com/serhatbolsu/robotframework-appiumlibrary
Note:
JSON Wire Protocol is still compatible with Momentum Suite, but there will be no documentation for these old clients.

Related Posts
Leave a Reply

Your email address will not be published.Required fields are marked *