在Sikuli脚本中,我们有不同的断言方式,如Screen.exists(a.png)等用于图像断言。但有人可以告诉我如何使用屏幕截图文件断言应用程序屏幕。
我的要求是,我正在登录Windows应用程序,登录后我想验证出现的屏幕,其中包含先前捕获的屏幕截图文件(.png)。
Sikuli api 1.0.2 Windows 7 64位
答案 0 :(得分:0)
这应该对你有帮助 -
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);
如果超时后结果为null,则表示应用程序中找到的图像与您提到的屏幕截图路径上的图像不匹配。