← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #658728]: How to work around an occasional image

 

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

    Status: Open => Answered

Roman Podolyan proposed the following answer:
======

def try_click("1506689574881.png"):
        try:
                click("1506689574881.png")
        except FindFailed:
                pass
======
That's wrong. 


Correct: 
======

# Function definition
def try_click(our_image):
        try:
                click(our_image)
        except FindFailed:
                pass

# function call
try_click("1506689574881.png")

======

You also may add later:

=====
try_click(image2)

try_click(image3)

=====

-- 
You received this question notification because your team Sikuli Drivers
is an answer contact for Sikuli.