← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #700532]: Sikulix hanging on region.exists(target, timeout), screen.exists(target, timeout) method, Region or Screen

 

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

    Status: Open => Answered

RaiMan proposed the following answer:
Made some tests and did not find any reason, why exists(..., 0) should hang internally.
There are loops, but none of them is "unchecked".

Adding
Debug.on(3)
reveals some internal logging, that shows, how the find op proceeds.

If you do not trust the exists(..., 0) (because of a possible internal "unchecked loop"), a possible wrapper/substitute could be:
try {
    return screen.find(imagename);
} catch {
    return null;
}

find internally only searches once and does not have a wait loop
internally.

For the above I suppose that you are not using the features
handleImageMissing and handleFindFailed, which would be a more complex
situation.

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