← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #406565]: How to disable Sikuli from Popping up error message on failure?

 

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

    Status: Open => Answered

Roman Podolyan proposed the following answer:
I thing you can build your custom function to decide what you want to do
when script cann't find image.

Here is a piece of my code: 
______
def try_click(our_image):       # click-function with exception catched
        try:
                click(our_image)
        except FindFailed:
                pass
______

FindFailed is the exception generated when Sikuli doesn't find image.
Instead of "pass" (placeholder instruction doing nothing) you can put
there whatever you want, including logging to some file.

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