Skip to content

Instantly share code, notes, and snippets.

@derinbay
Last active March 8, 2018 07:27
Show Gist options
  • Save derinbay/8d181ec45bfbe2b493aca5113c0691d2 to your computer and use it in GitHub Desktop.
Save derinbay/8d181ec45bfbe2b493aca5113c0691d2 to your computer and use it in GitHub Desktop.
DesiredCapabilities capability = new DesiredCapabilities();
capability.setCapability(CapabilityType.VERSION, "7.1");
capability.setCapability(MobileCapabilityType.DEVICE_NAME, "Emulator");
capability.setCapability(MobileCapabilityType.UDID, null);
capability.setCapability(MobileCapabilityType.NEW_COMMAND_TIMEOUT, timeOut);
capability.setCapability(MobileCapabilityType.APP, POOL_WEB_SERVICE_URL + "mobileapps/mfandroid-automation.apk");
capability.setCapability(MobileCapabilityType.BROWSER_NAME, "android");
capability.setCapability(MobileCapabilityType.AUTOMATION_NAME, "UiAutomator2");
capability.setCapability("appActivity", "com.dmall.mfandroid.activity.base.NHomeActivity");
capability.setCapability("sendKeyStrategy", "setValue");
Wedriver androidDriver = new AndroidDriver(new URL(SELENIUM_GRID_HUB_URL), capability);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment