← Back to team overview

sikuli-driver team mailing list archive

[Question #205413]: trying to trap errors in sikili script not quite working

 

New question #205413 on Sikuli:
https://answers.launchpad.net/sikuli/+question/205413

Hello:

I am trying to trap errors in a sikuli script and it is not quite doing what I expect.
here is the scenario:

I look for an image on the screen.  If the image does not exist, I display an error message and then exit the script at that point.  Well .. .this is my intent.  What sikuli does is try to execute the next few statements afterwards and then the script stops with an error a few lines down.

Here is a snippet of what I am talking about in code:

------------------------------------------------------------
find("1344004317402.png")
if not exists("1344004317402.png"):
    print"[error]: Can't Start Application"
    exit(1)
else:
    click("1344004329798.png")

-------------------------------------------------------------

Just need some guidance on what I may be doing not quite right.
thanks!

ironmantis7x

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