while exists (img,0) always stop loop

Asked by alex on 2017-06-24

while exists ("1498312677594.png"):
      if exists (Pattern("1498307427007.png").exact(),0):
          print "Found Deniro*"

 the problem here is..when dont find click(Pattern("1498310847322.png").similar(0.90)) it just break the loop

Question information

English Edit question
Sikuli Edit question
No assignee Edit question
Last query:
Last reply:
masuo (masuo-ohara) said : #1

What do you want to do when 1498310847322.png is not found?

alex (alexdniel88) said : #2

thanks for ur kindness respond..what i want is..when is not found..
i want the sikuli search again that "1498310847322.png"
is it possible?

masuo (masuo-ohara) said : #3

If image dose not exist when using click() and find() and wait(), FindFailed exception occurs.

How to continue SikuliX process even if FindFailed exception will occur.

[sample codes]
while True:
        print "Appeared"
    except FindFailed:
        print "FindFailed"

A way to use exists() that dose not raise FindFailed exception.

[sample codes]
while True:
    if not exists("1498310847322.png",0):

Can you help with this problem?

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

To post a message you must log in.