← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #647444]: Running sikuli script on different machine

 

Question #647444 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/647444

    Status: Open => Answered

RaiMan proposed the following answer:
Based on how SikuliX works:
http://sikulix-2014.readthedocs.io/en/latest/basicinfo.html#sikulix-how-does-it-find-images-on-the-screen

the only condition needed, to be able to use the same images on other machines:
- the image must be present in a screenshot on the other machines in the same size (width x height) measured in pixels 
- and the pixels must have the same content (to a high degree at least) 

The first condition is usually met, if screen dimension measured in
pixels and the resulting rendering has the same width-height-ratio as
the original system. Though depending on resolution (dpi), the images
might look smaller or larger, but are found by SikuliX.

The second condition depends on several aspects of the other system:
- if GUI-themes differ at the pixel level (colors, edges, button-design, ...)
- if apps like browsers do a different rendering on other machines
- other aspects, that influence, how something is displayed on a screen at the pixel level (e.g. anti-aliasing with fonts, ...)

So if you plan to use the same image set on different machines, just
decide for a few base images, that are used for a compatibility test,
before running into problems with a complex workflow, that is not
designed to handle not-found-situations, that are caused by incompatible
rendering.

In the worst case, you have to be prepared to recapture your images on
the other machines and work with image sets, that are switched according
to the situation on the current machine.

... and obey the "Golden Rule" of SikuliX:
A capture should have as little background at the edges as possible (less than 20% counted in pixels) and should concentrate on the unique aspects of the image.

-- 
You received this question notification because your team Sikuli Drivers
is an answer contact for Sikuli.