Package org.uiautomation.ios.UIAModels

Examples of org.uiautomation.ios.UIAModels.UIARect


    Long y = origin.get("y");

    Long height = size.get("height");
    Long width = size.get("width");

    UIARect res = new UIARect(x.intValue(), y.intValue(), height.intValue(), width.intValue());
    return res;
  }
View Full Code Here


    PropertyEqualCriteria c2 = new NameCriteria(buttonName);
    Assert.assertEquals(c2.getMatchingStrategy(), MatchingStrategy.exact);
    Criteria c = new AndCriteria(c1, c2);
    UIAElement element = driver.findElement(c);

    UIARect position = element.getRect();

    //center
    Criteria
        test =
        new LocationCriteria(position.getX() + (position.getWidth() / 2),
                             position.getY() + (position.getHeight() / 2));
    UIAElement res = driver.findElement(test);
    Assert.assertEquals(res.getName(), buttonName);

    // bottom right corner
    int x = position.getX() + position.getWidth() - 1;
    int y = position.getY() + position.getHeight() - 1;
    test = new LocationCriteria(x, y);
    res = driver.findElement(test);
    Assert.assertEquals(res.getName(), buttonName);

    // middle
    x = position.getX() + (position.getWidth() / 2);
    y = position.getY() + (position.getHeight() / 2);
    test = new LocationCriteria(x, y);
    res = driver.findElement(test);
    Assert.assertEquals(res.getName(), buttonName);
  }
View Full Code Here

TOP

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

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.