← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #268710]: Trap Error

 

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

    Status: Answered => Open

Jeff_Vallis is still having a problem:
Not what I am trying to avoid
the problem is :-
if exists(an image)
    doubleClick(the same image)
Now you would think this is safe however the delay between checking if it exists and doing the double click very occasionally means that the image is no longer there - my log file proves this.
So I examined your code on the link above using try: and exception.
( an aside comment - if m: # this is a FindFailed "never happens" - m = reFindFailed.match(str(errB)) "must have changed"  )
but ignoring that I see that I can trap the error by putting This_isMain() after a try and indenting it - but cannot figure out how to do this more than once on the example above e.g.
except:
   your code without the popup
   This_Is_Main() - result - on the first error it starts again but now I am outside of the try:
but here I am asking for help with my solution to exists/doubleClick problem and may be approack=hing it in the wrong way.

explaining very occasionally :-
The Procedure has 80 Exists followed by click or doubleClick
in one session the Procedure is called 20 times - 1600 exists
the session is done 4 times in one day - 6400 exists
very occasionally - maybe 2 or 3 times in 6400
but if I could just figure this out then no fails

B.T.W. you were right
running from the command line solved my previous problems were I was running direct from the editor - so instead of input I now use a file to set the parameters for each session

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