← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #701210]: Same image not found on different devices/systems --- especially with textual content

 

Question #701210 on SikuliX changed:
https://answers.launchpad.net/sikuli/+question/701210

Gjorgji posted a new comment:
The resolution I mentioned above helped me, that is taking an image of
the same thing from different environments (OSes), and using the needed
one.


I accomplished this by having a function that checks on which OS the script is ran, and returns it as a string. Let's say the function is named `which_os()`

Then when taking screenshots I have it set up to name the images
manually, and follow a naming convention where at the end of the name I
add `_OS`, i.e. `button1_linux.png`, `button1_macos.png`,
`button1_windows.png`, etc.

Afterward, if for instance, I need Sikuli to click that button, I've written it like this:
`click("button1_" + which_os() + ".png")

This way, if I keep following the same naming convention, no matter on
which OS I ran the script, if there's a screenshot for that button for
that OS, it will find it and use it, and it will not experience the
issue mentioned above.

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