Confuse in sikuli search behavior

Asked by manas

if find("VNkai.png"):
    print "PASS"
else:
     print "FAIL"
I am trying to search one image in a screen ,but the searching image is there or not every time my out put is PASS. Where is the problem in my script?

Question information

Language:
English Edit question
Status:
Answered
For:
SikuliX Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
RaiMan (raimund-hocke) said :
#1

If you want to do something like this with if, use exists instead of find (see faq 1501), since find aborts the script on FindFailed.

faq 1607 might have some more hints.

Can you help with this problem?

Provide an answer of your own, or ask manas for more information if necessary.

To post a message you must log in.