简体   繁体   English

在多台计算机上运行 Sikuli 脚本

[英]Running a Sikuli script in multiple computers

I have a Sikuli script written in java to click the windows start button and then click "All Programs" as appear.我有一个用 Java 编写的 Sikuli 脚本,用于单击 Windows 开始按钮,然后单击出现的“所有程序”。 The script works absolutely fine on my computer but when I transfer the same script to another computer, it doesn't work.该脚本在我的计算机上运行得非常好,但是当我将相同的脚本传输到另一台计算机时,它不起作用。

Code:代码:

Screen screen = new Screen();
screen.type(Key.WIN); 
screen.click(IMAGE_DIR + "program.PNG");

I used concepts like Wait , Pattern and similar but not able to solve this issue.我使用了WaitPattern等概念,但无法解决这个问题。 Not sure if this is a limitation of sikuli.不确定这是否是 sikuli 的限制。

Like was already mentioned in the comments, differences in screens resolutions will definitely ruin your existing scripts as Sikuli is super sensitive to them. 就像评论中已经提到的那样,屏幕分辨率的差异肯定会破坏您现有的脚本,因为Sikuli对它们非常敏感。 In such case, the only solution is to recapture the patterns and use a different set of them on each machine. 在这种情况下,唯一的解决方案是重新捕获模式并在每台机器上使用不同的模式集。

However, if you have such issue but screens resolutions seem to be identical, there are few more things that should be checked. 但是,如果您遇到此类问题,但屏幕分辨率似乎相同,则应检查的内容很少。

Clear Type , which is Microsoft's implementation of subpixel rendering that is supposed to improve the fonts visual appearance. Clear Type ,这是Microsoft对亚像素渲染的实现,旨在改善字体的视觉外观。 If you have this feature switch on on one machine and switched off on another, that might be an issue. 如果您在一台计算机上打开了此功能,而在另一台计算机上关闭了此功能,则可能是一个问题。

Smooth Edges of screen fonts setting that can be found in the "Visual Effects" settings window in "Performance Options". 屏幕字体设置的“ 平滑边缘 ”设置可在“性能选项”的“视觉效果”设置窗口中找到。 It does exactly what it says, smooths windows fonts to improve the looks. 它完全按照其说的做,平滑Windows字体以改善外观。 As in the case of ClearType, this feature should be switched off or on on both machines you run your scripts on. 与ClearType一样,应在运行脚本的两台计算机上关闭或打开此功能。 The general recommendation to have the always off to avoid this kind of issues. 通常建议您始终准备避免此类问题。

For those still using Sikuli and experiencing inconsistency when running across different machines, it's helpful to debug on the boxes that are showing the issue.对于那些仍在使用 Sikuli 并且在不同机器上运行时遇到不一致问题的人来说,在出现问题的机器上进行调试会很有帮助。

Some things like issues around various AppData temp files not being managed correctly can show up in some PCs but not others.一些问题,例如围绕各种 AppData 临时文件未正确管理的问题,可能会出现在某些 PC 中,但不会出现在其他 PC 中。 It's a pain to install your IDE into different places but it sometimes is the only way to really see what's going wrong - and be able to fix it.将您的 IDE 安装到不同的位置是一种痛苦,但有时这是真正了解出了什么问题并能够修复它的唯一方法。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM