← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #209147]: if exists with try catch

 

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

    Status: Open => Answered

RaiMan proposed the following answer:
Sikuli thinks, it has found imgA with a similarity >0.7, which might be
a false positive.

to debug:

if exists(imgA):
    print "img A exists"
    getLastMatch().highlight(3)
    try:
...

this will visually show you, what was found.

Since it seems not to be, what you want:
- make a better shot of your image (as little background as possible, concentrate on the key parts)
- use Pattern(imgA).similar(0.95) instead of imgA, to get better results.

BTW: your code looks odd ;-)

if exists(imgA):
    click(getLastMatch())
else:
   click(imgB)

run this in slow motion and you can see what is clicked.

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