0
votes

In Sikuli script, we have different ways of asserting like Screen.exists(a.png) etc for image assertion. But can someone please tell me how to assert an application screen with a screenshot file.

My requirement is that, I'm logging into a windows application, and after logging in I want to verify the screen that appears with a screenshot file(.png) captured earlier.

Sikuli api 1.0.2 Windows 7 64 bit

1

1 Answers

0
votes

This should help you-

int timeout = <Specify timeout in millis>;
String imagePath = <give the path of your screenshot image here>;
ImageTarget target = new ImageTarget(new File(imagePath));
ScreenRegion result = desktop.wait(target,timeout);

Here if result is null after the timeout, it would mean the image found in the application does not match the one at the path of the screenshot you would have mentioned.