← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #213457]: exists function not working after defining region

 

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

    Status: Open => Answered

RaiMan proposed the following answer:
Since the highlight is animated and takes some time to vanish (which happens asynchronously), you have to either 
- forego the last highlight() and rely on the print (highlight() + print does not make sense anyway, because the highlight() itself prints a log message with the same information)
- put a wait(0.5) (should be enough, but test the correct value) after the getLastMatch(), when you repeat the same search directly afterwards
- use an alternative for the assertion:

principally:
if exists():
    highlight()
    assert True
else:
    assert False

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