Search in sources :

Example 1 with MobileElement

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());
}
Also used : MobileElement(io.appium.java_client.MobileElement) AndroidElement(io.appium.java_client.android.AndroidElement) Test(org.junit.Test)

Example 2 with MobileElement

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']"))));
}
Also used : MobileElement(io.appium.java_client.MobileElement) WebDriverWait(org.openqa.selenium.support.ui.WebDriverWait) Test(org.junit.Test)

Example 3 with MobileElement

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");
}
Also used : MobileElement(io.appium.java_client.MobileElement) Test(org.junit.Test)

Example 4 with MobileElement

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");
}
Also used : MobileElement(io.appium.java_client.MobileElement) Test(org.junit.Test)

Example 5 with MobileElement

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");
}
Also used : MobileElement(io.appium.java_client.MobileElement) Test(org.junit.Test)

Aggregations

MobileElement (io.appium.java_client.MobileElement)27 Test (org.junit.Test)12 By (org.openqa.selenium.By)11 Point (org.openqa.selenium.Point)7 TouchAction (io.appium.java_client.TouchAction)6 Dimension (org.openqa.selenium.Dimension)6 MultiTouchAction (io.appium.java_client.MultiTouchAction)4 WebDriverWait (org.openqa.selenium.support.ui.WebDriverWait)3 PublicAtsApi (com.axway.ats.common.PublicAtsApi)1 MobileOperationException (com.axway.ats.uiengine.exceptions.MobileOperationException)1 VerificationException (com.axway.ats.uiengine.exceptions.VerificationException)1 AndroidElement (io.appium.java_client.android.AndroidElement)1 IOSDriver (io.appium.java_client.ios.IOSDriver)1 ElementOption (io.appium.java_client.touch.offset.ElementOption)1 PointOption.point (io.appium.java_client.touch.offset.PointOption.point)1 Rectangle (java.awt.Rectangle)1 MalformedURLException (java.net.MalformedURLException)1 URL (java.net.URL)1 AppiumHelper.getCapabilityAsString (org.getopentest.appium.core.AppiumHelper.getCapabilityAsString)1 Config (org.getopentest.util.Config)1