Search code examples
javaautomationsikuli

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. 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. Not sure if this is a limitation of sikuli.


Solution

  • Like was already mentioned in the comments, differences in screens resolutions will definitely ruin your existing scripts as Sikuli is super sensitive to them. 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. 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. As in the case of ClearType, this feature should be switched off or on on both machines you run your scripts on. The general recommendation to have the always off to avoid this kind of issues.