← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #697937]: image not found during 2nd run

 

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

    Status: Open => Answered

RaiMan proposed the following answer:
In the first run find() searches on the whole screen.
After that you use setRect(), which also changes the constant SCREEN (main screen), to only the given area.

Since the Python interpreter context is static, changes to global
variables are remembered in the next run.

As the error tells you:
FindFailed ( mypicture.png: (48x25) seen at (527, 325) with 0.90 in R[123,123 123x123]@S(0) 

it was found at (527, 325) which surely is outside of R[123,123
123x123].

So you should use Region() to define area objects:
myRect = Region(123,123,123,123)

Not sure if you know that:
from sikuli import *
is not needed in the main script, when using SikuliX to run the script.

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