← 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

TestMechanic proposed the following answer:
David,

As far as I understand you have some workflow that have occasional
images only at some steps. Why not just at those places use this logic

def WaitMainOrOccasuionalImage(mainImage,occasionalImage):
 while True: # endless loop for the main image - return only when main image is found&clicked
    if exists(mainImage): click(); return
    if exists(occasionalImage): click()

wait(imageA,FOREVER); click()
wait(imageB,FOREVER); click()
type("username")
wait(imageC,FOREVER); click()
type("password")
wait(imageD,FOREVER); click()
WaitMainOrOccasuionalImage(imageF,image1)
wait(imageG,FOREVER); click()
...

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