Assert.assertEquals(element.getName(), buttonName);
}
@Test
public void positionMatch() {
Criteria c1 = new TypeCriteria(UIATableCell.class);
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);