use of io.appium.java_client.MobileElement in project java-client by appium.
the class AndroidTest 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());
}
use of io.appium.java_client.MobileElement in project java-client by appium.
the class UIAutomator2Test method testToastMSGIsDisplayed.
@Test
public void testToastMSGIsDisplayed() {
final WebDriverWait wait = new WebDriverWait(driver, 10);
Activity activity = new Activity("io.appium.android.apis", ".view.PopupMenu1");
driver.startActivity(activity);
MobileElement popUpElement = driver.findElement(MobileBy.AccessibilityId("Make a Popup!"));
popUpElement.click();
driver.findElement(By.xpath(".//*[@text='Search']")).click();
assertNotNull(wait.until(ExpectedConditions.presenceOfElementLocated(By.xpath("//*[@text='Clicked popup menu item Search']"))));
popUpElement.click();
driver.findElement(By.xpath(".//*[@text='Add']")).click();
assertNotNull(wait.until(ExpectedConditions.presenceOfElementLocated(By.xpath("//*[@text='Clicked popup menu item Add']"))));
popUpElement.click();
driver.findElement(By.xpath(".//*[@text='Edit']")).click();
assertNotNull(wait.until(ExpectedConditions.presenceOfElementLocated(By.xpath("//*[@text='Clicked popup menu item Edit']"))));
driver.findElement(By.xpath(".//*[@text='Share']")).click();
assertNotNull(wait.until(ExpectedConditions.presenceOfElementLocated(By.xpath("//*[@text='Clicked popup menu item Share']"))));
}
use of io.appium.java_client.MobileElement in project java-client by appium.
the class IOSDriverTest method hideKeyboardWithParametersTest.
@Test
public void hideKeyboardWithParametersTest() {
MobileElement element = driver.findElementById("IntegerA");
element.click();
driver.hideKeyboard(HideKeyboardStrategy.PRESS_KEY, "Done");
}
use of io.appium.java_client.MobileElement in project java-client by appium.
the class IOSScrollingSearchingTest method scrollByDriver.
@Test
public void scrollByDriver() {
MobileElement slider = driver.findElement(MobileBy.IosUIAutomation(".tableViews()[0]" + ".scrollToElementWithPredicate(\"name CONTAINS 'Slider'\")"));
assertEquals(slider.getAttribute("name"), "Sliders");
}
use of io.appium.java_client.MobileElement in project java-client by appium.
the class IOSScrollingSearchingTest method scrollByElement.
@Test
public void scrollByElement() {
MobileElement table = driver.findElement(MobileBy.IosUIAutomation(".tableViews()[0]"));
MobileElement slider = table.findElement(MobileBy.IosUIAutomation(".scrollToElementWithPredicate(\"name CONTAINS 'Slider'\")"));
assertEquals(slider.getAttribute("name"), "Sliders");
}
Aggregations