@Keyword("Validate window position")
@Parameters(min = 2, max = 4)
public void validateWindowPosition(int expectedX, int expectedY,
Integer deltaX, Integer deltaY) {
Point expected = new Point(expectedX, expectedY);
Point actual = toolkit.windowInstructions().getWindowPosition();
Point delta = (deltaX == null && deltaY == null) ? null : new Point(
deltaX, deltaY);
boolean flag = SeleniumToolkit.withinRange(expected, actual, delta);
publish(new SetStatusEvent(flag));
if (flag == false) {
String format = "Window position (%s) not within the specified range";
String error = String.format(format, expected.toString());
log().error(error);
}
}