1
votes

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.

2
How do you run your script? Is it same way in both cases? Do you get any errors? Where exactly does your code fails? - Eugene S
In my experience, unless the two computers have exactly the same setup for their monitors (size, resolution, etc) Sikuli will likely fail when trying to find images on the second computer. If the same thing can be accomplished through keystrokes or keyboard shortcuts, you'll have better luck, imo. - autoKarma
@Eugene: As mentioned by autoKarma it is not able to find the image in the second computer, but display resolution etc are same except the second machine is a Laptop - Sanjit Kumar Mishra
And this is exactly why I asked all these questions. To be able to understand where your problem lies. - Eugene S
@EugeneS: If you have a solution for the same can you please help me with. - Sanjit Kumar Mishra

2 Answers

1
votes

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.

0
votes

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.

Some things like issues around various AppData temp files not being managed correctly can show up in some PCs but not others. 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.