Package org.uiautomation.ios.UIAModels

Examples of org.uiautomation.ios.UIAModels.UIAAlert


        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>"));

    String version = driver.getCapabilities().getSDKVersion();
    IOSVersion v = new IOSVersion(version);
    Class type;
    if (v.isGreaterOrEqualTo("7")) {
      type = UIATableCell.class;
    } else {
      type = UIAButton.class;
    }

    UIAElement ok = alert.findElement(type, new NameCriteria("OK"));

    ok.tap();
    // wait for the alert to disappear.
    Thread.sleep(500);
    driver.switchTo().alert();
View Full Code Here

TOP

Related Classes of org.uiautomation.ios.UIAModels.UIAAlert

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.