Package org.uiautomation.ios.UIAModels.predicate

Examples of org.uiautomation.ios.UIAModels.predicate.TypeCriteria


  public void releaseKey(CharSequence keyToRelease) {
    getCurrentKeyboard().releaseKey(keyToRelease);
  }

  private Keyboard getCurrentKeyboard() {
    return (Keyboard) driver.findElement(new TypeCriteria(UIAKeyboard.class));
  }
View Full Code Here


    } catch (NoSuchWindowException e) {
      // expected
    }
    UIAElement el =
        driver.findElement(
            new AndCriteria(new TypeCriteria(UIATableCell.class), new NameCriteria("Web",
                MatchingStrategy.starts)));
    el.tap();

    while (driver.getWindowHandles().size() != 2) {
      Thread.sleep(50);
    }
    handles = driver.getWindowHandles();
    Assert.assertEquals(handles.size(), 2);

    UIAElement back = driver
        .findElement(
        new AndCriteria(new TypeCriteria(UIAButton.class), new NameCriteria("Back")));
    back.tap();
    long deadline = System.currentTimeMillis() + 5000;
    while (driver.getWindowHandles().size() != 1) {
      Thread.sleep(50);
      if (System.currentTimeMillis() > deadline) {
View Full Code Here

    long lastCommandStarted = 0;
    try {
      while (true) {
        // check that we can't execute new command after the session has timed out.
        lastCommandStarted = System.currentTimeMillis() - started;
        driver.findElement(new TypeCriteria(UIAElement.class));
        Thread.sleep(250);
      }

    } catch (WebDriverException e) {
      Assert.assertTrue(e.getMessage().contains(ServerSideSession.StopCause.sessionTimeout.name()));
View Full Code Here

    driver = new RemoteIOSDriver(getRemoteURL(), SampleApps.uiCatalogCap());
    Set<String> handles = driver.getWindowHandles();
    Assert.assertEquals(handles.size(), 1);
    UIAElement webCell =
        driver.findElement(new AndCriteria(new TypeCriteria(UIATableCell.class), new NameCriteria(
            "Web", MatchingStrategy.starts)));
    webCell.tap();

    handles = driver.getWindowHandles();
    Assert.assertEquals(handles.size(), 2);
View Full Code Here

    driver = new RemoteIOSDriver(getRemoteURL(), SampleApps.uiCatalogCap());
    Set<String> handles = driver.getWindowHandles();
    Assert.assertEquals(handles.size(), 1);
    UIAElement webCell =
        driver.findElement(new AndCriteria(new TypeCriteria(UIATableCell.class), new NameCriteria(
            "Web", MatchingStrategy.starts)));
    webCell.tap();

    Thread.sleep(5000);
    driver.switchTo().window("Web");
View Full Code Here

  }

  @Override
  public <T extends UIAElement> T findElement(Class<T> type, Criteria c)
      throws NoSuchElementException {
    Criteria newOne = new AndCriteria(new TypeCriteria(type), c);
    return (T) findElement(newOne);
  }
View Full Code Here

  @Test
  public void canFindElementInAlertIfAlertOpened() throws Exception {
    Criteria
        c =
        new AndCriteria(new TypeCriteria(UIAStaticText.class), new NameCriteria("Show Simple"));
    UIAElement el = driver.findElements(c).get(1);
    // opens an alert.
    el.tap();

    try {
View Full Code Here

  @Test
  public void canSeeAlertsAsWebElements() throws Exception {
    RemoteWebDriver d = (RemoteWebDriver) driver;
    Criteria
        c =
        new AndCriteria(new TypeCriteria(UIAStaticText.class), new NameCriteria("Show Simple"));
    UIAElement el = driver.findElements(c).get(1);
    try {
      d.findElement(By.className("UIAAlert"));
      Assert.fail("should not find alert when there isn't any");
    } catch (NoSuchElementException e) {
View Full Code Here

  @Test(expectedExceptions = NoAlertPresentException.class)
  public void checkUIAlertView() throws Exception {

    Criteria
        c =
        new AndCriteria(new TypeCriteria(UIAStaticText.class), new NameCriteria("Show Simple"));
    UIAElement el = driver.findElements(c).get(1);
    // opens an alert.
    el.tap();

    UIAAlert alert = driver.findElement(new TypeCriteria(UIAAlert.class));

    // check the alert has all its elements
    alert.findElement(UIAStaticText.class, new NameCriteria("UIAlertView"));
    alert.findElement(UIAStaticText.class, new NameCriteria("<Alert message>"));
View Full Code Here

  @Test
  public void getElement() throws InterruptedException {
    driver = getDriver(SampleApps.uiCatalogCap());
    String name = "Buttons, Various uses of UIButton2";

    Criteria c1 = new TypeCriteria(UIATableCell.class);
    Criteria c2 = new NameCriteria(name);
    Criteria c = new AndCriteria(c1, c2);
    long start = System.currentTimeMillis();
    try {
      driver.findElement(c);
View Full Code Here

TOP

Related Classes of org.uiautomation.ios.UIAModels.predicate.TypeCriteria

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.