Java Code Examples for org.openqa.selenium.remote.DesiredCapabilities.android()

The following are Jave code examples for showing how to use android() of the org.openqa.selenium.remote.DesiredCapabilities class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
+ Save this method
Example 1
Project: Actitime-Framework   File: DriverFactory.java   View Source Code Vote up 7 votes
/**
 * This method runs scripts in a mobile application
 **/
@SuppressWarnings("rawtypes")
protected WebDriver setupApp(String browser) throws MalformedURLException, InterruptedException {
	File app = new File("./src/test/resources/apk/FormApp.apk");
	DesiredCapabilities capabilities = DesiredCapabilities.android();
	capabilities.setCapability("appium-version", "1.4.16.1");
	capabilities.setCapability("automationName", Driver.getAutomationName());
	capabilities.setCapability("deviceName", Driver.getDeviceName());
	capabilities.setCapability("platformName", Driver.getPlatformName());
	capabilities.setCapability("platformVersion",Driver.getPlatformVersion());
	capabilities.setCapability("device", Driver.getDevice());
	capabilities.setCapability("app", app.getAbsolutePath());
	capabilities.setCapability("noReset", Driver.getNoReset());
	capabilities.setCapability("fullReset", Driver.getFullReset());
	capabilities.setCapability("appActivity", "com.anuj.task1.FormLogin");
	driver = new AndroidDriver(new URL("http://127.0.0.1:4723/wd/hub"),capabilities);
	return driver;
}
 
Example 2
Project: Actitime-Framework   File: DriverFactory.java   View Source Code Vote up 5 votes
/**
 * This method runs scripts in a device browser
 **/
@SuppressWarnings("rawtypes")
protected WebDriver setup(String browser) throws MalformedURLException, InterruptedException {
	DesiredCapabilities capabilities = DesiredCapabilities.android();
	capabilities.setCapability("automationName", Driver.getAutomationName());
	capabilities.setCapability("deviceName", Driver.getDeviceName());
	capabilities.setCapability("platformName", Driver.getPlatformName());
	capabilities.setCapability("platformVersion", Driver.getPlatformVersion());
	capabilities.setCapability("app", Driver.getApp());
	capabilities.setCapability("device", Driver.getDevice());
	driver = new AndroidDriver(new URL("http://127.0.0.1:4723/wd/hub"),capabilities);
	return driver;
}