use of io.appium.java_client.android.AndroidDriver in project selenium-tests by Wikia.
the class AndroidBrowser method setOptions.
@Override
public void setOptions() {
DesiredCapabilities destCaps = new DesiredCapabilities();
destCaps.setCapability("deviceName", Configuration.getDeviceName());
URL url = null;
try {
url = new URL("http://" + Configuration.getAppiumIp() + "/wd/hub");
} catch (MalformedURLException e) {
PageObjectLogging.log("getAndroindInstance", e, false);
}
mobileDriver = new AndroidDriver(url, destCaps);
}
use of io.appium.java_client.android.AndroidDriver in project ats-framework by Axway.
the class MobileCheckBox method unCheck.
/**
* Uncheck the check box
*/
@Override
@PublicAtsApi
public void unCheck() {
new MobileElementState(this).waitToBecomeExisting();
try {
WebElement checkboxElement = MobileElementFinder.findElement(appiumDriver, this);
if (checkboxElement.isSelected()) {
if (appiumDriver instanceof AndroidDriver) {
// checkboxElement.click(); // throwing exception (on Android) with message: Element is not clickable at point (x,y). Other element would receive the click
new Actions(appiumDriver).moveToElement(checkboxElement).click().perform();
} else {
checkboxElement.click();
}
}
} catch (Exception se) {
throw new MobileOperationException(this, "unCheck", se);
}
UiEngineUtilities.sleep();
}
use of io.appium.java_client.android.AndroidDriver in project android by owncloud.
the class Common method setUpCommonDriver.
protected AndroidDriver setUpCommonDriver() throws Exception {
File rootPath = new File(System.getProperty("user.dir"));
File appDir = new File(rootPath, "src/test/resources");
File app = new File(appDir, "ownCloud.apk");
DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.setCapability("platformName", "Android");
capabilities.setCapability("deviceName", "test");
capabilities.setCapability("app", app.getAbsolutePath());
capabilities.setCapability("appPackage", "com.owncloud.android");
capabilities.setCapability("appActivity", ".ui.activity.FileDisplayActivity");
capabilities.setCapability("appWaitActivity", ".authentication.AuthenticatorActivity");
driver = new AndroidDriver(new URL("http://127.0.0.1:4723/wd/hub"), capabilities);
driver.manage().timeouts().implicitlyWait(waitingTime, TimeUnit.SECONDS);
wait = new WebDriverWait(driver, waitingTime, 50);
return driver;
}
use of io.appium.java_client.android.AndroidDriver in project ats-framework by Axway.
the class MobileCheckBox method check.
/**
* Check the check box
*/
@Override
@PublicAtsApi
public void check() {
new MobileElementState(this).waitToBecomeExisting();
try {
WebElement checkboxElement = MobileElementFinder.findElement(appiumDriver, this);
if (!checkboxElement.isSelected()) {
if (appiumDriver instanceof AndroidDriver) {
// checkboxElement.click(); // throwing exception (on Android) with message: Element is not clickable at point (x,y). Other element would receive the click
new Actions(appiumDriver).moveToElement(checkboxElement).click().perform();
} else {
checkboxElement.click();
}
}
} catch (Exception se) {
throw new MobileOperationException(this, "check", se);
}
UiEngineUtilities.sleep();
}
Aggregations