use of io.appium.java_client.MobileElement in project opentest by mcdcorp.
the class AssertElementEnabled method run.
@Override
public void run() {
super.run();
By locator = readLocatorArgument("locator");
this.swipeAndCheckElementVisible(locator, this.getSwipeOptions());
MobileElement element = getElement(locator);
if (!element.isEnabled()) {
throw new RuntimeException(String.format("Element %s was not enabled", locator));
}
}
use of io.appium.java_client.MobileElement in project opentest by mcdcorp.
the class AssertElementNotEnabled method run.
@Override
public void run() {
super.run();
By locator = this.readLocatorArgument("locator");
this.swipeAndCheckElementVisible(locator, this.getSwipeOptions());
MobileElement element = this.getElement(locator);
if (element.isEnabled()) {
throw new RuntimeException(String.format("Element %s was enabled", locator));
}
}
use of io.appium.java_client.MobileElement in project ats-framework by Axway.
the class MobileElementState method focus.
/**
* Moves the focus to the specified element. Currently issued with tap
*/
@PublicAtsApi
public void focus() {
try {
MobileElement mobileElement = (MobileElement) MobileElementFinder.findElement(appiumDriver, element);
mobileElement.tap(1, 100);
} catch (Exception se) {
throw new MobileOperationException("Error trying to set the focus to " + getElementDescription(), se);
}
}
use of io.appium.java_client.MobileElement in project java-client by appium.
the class AndroidAbilityToUseSupplierTest method horizontalSwipingWithSupplier.
@Test
public void horizontalSwipingWithSupplier() {
Activity activity = new Activity("io.appium.android.apis", ".view.Gallery1");
driver.startActivity(activity);
AndroidElement gallery = driver.findElementById("io.appium.android.apis:id/gallery");
List<MobileElement> images = gallery.findElementsByClassName("android.widget.ImageView");
int originalImageCount = images.size();
horizontalSwipe.get().perform();
assertNotEquals(originalImageCount, gallery.findElementsByClassName("android.widget.ImageView").size());
}
use of io.appium.java_client.MobileElement in project java-client by appium.
the class AndroidElementTest method scrollingToSubElement.
@Test
public void scrollingToSubElement() {
driver.findElementByAccessibilityId("Views").click();
AndroidElement list = driver.findElement(By.id("android:id/list"));
MobileElement radioGroup = list.findElement(MobileBy.AndroidUIAutomator("new UiScrollable(new UiSelector()).scrollIntoView(" + "new UiSelector().text(\"Radio Group\"));"));
assertNotNull(radioGroup.getLocation());
}
Aggregations