← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #263726]: observe - coding structure

 

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

    Status: Open => Answered

RaiMan proposed the following answer:
this of course only works, if your script does not crash in the middle
caused by other problems.

the principle approach with some check at the end:

def handler(e):
     global success
     success = True
     e.stopobserver()

success = false
onAppear("image-of-popup")
observe(360, True) # observe runs in background for 6 minutes

your current script lines (excluding the processing after success)

wait(10) # to be sure, the popup has a chance to get visible before
script ends

if (success):
    # order was processed
else:
    # order did not work

Be aware:
This solution might only work reliable with the latest version 1.1.0

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