← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #244887]: Condition under if-elif is not working.

 

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

    Status: Needs information => Answered

RaiMan proposed the following answer:
this works as expected:

import random
def FeedbackQuestion(question):
#    find(question)
    num = random.randint(1,3)
    print "button to click:", num
    eval("hover(radioOption%d)" % num)

radioOption1 = "1393859382905.png"
radioOption2 = "1393859401498.png"
radioOption3 = "1393859424499.png"

for i in range(5):
    FeedbackQuestion(None)

*** output:
button to click: 2
button to click: 1
button to click: 3
button to click: 2
button to click: 2

… and the mouse moves to the respective match

I ran it in slow motion to see the hover targets

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