← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #169103]: onAppear Vs exists

 

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

    Status: Open => Answered

RaiMan proposed the following answer:
Generally spoken, using the observer feature (onAppear(), ...) () is
more complex than using exists and so it only makes sense in situations,
where you want to wait for something in the background or in parallel to
your normal workflow (e.g. a popup, that appears in a not predictable
way).

If you want to find something inline with your workflow (with or without
extensive waiting), exists() is the first choice (easy and straight
forward), if you want to avoid script aborts with FindFailed exceptions.

*** Your solution:
You may use a loop and exists() at every image position with the image probe you are looking for. This will take some time (in average 12.5 x time-to-check-one-image).
But why not make one exists() on the whole table region and then calculate the table position of the found image based on the coordinates of the match.

-- 
You received this question notification because you are a member of
Sikuli Drivers, which is an answer contact for Sikuli.