← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #203958]: Sikuli is stuck finding one image that no longer exists

 

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

    Status: Open => Answered

RaiMan proposed the following answer:
--1. debugging
to debug such problems, it is better to either use highlight(), to see, what Sikuli finds.

--2. waitVanish()
is nothing better, than while exists(), but even more flexible ;-)

This would be my script variant

def estoyListo():
    if exists(img_readyNow): 
        click(getLastMatch())
    while exists(img_dontPanic):
        getLastMatch().highlight(2) # for debugging only
        wait(1)
    if exists(img_repairDamage): 
        click(getLastMatch())
    while exists(img_close):
        click(getLastMatch())
        wait(1)

So you now cans see, what Sikuli "thinks" dontPanic might be on your screen.
If it is a false positive, you might either:
- make a better screenshot (minimum background)
- restrict the search region ( some-Region.exists() )
- raise the similarity ( exists(Pattern(img_repairDamage).similar(0.95)) )

BTW: The last loop does not really make sense, since it clicks as long
as the image is visible. Usually one click is enough.

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