← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #165990]: mutiple choices problem sikuli

 

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

    Status: Open => Answered

RaiMan proposed the following answer:
First you have to "know" in the script, at which element in the matrix
you are. Then you can click the buttons relative to this position.

So it depends on, how you select an entry, that you want to click digg
and confirm.

example: click all entries in the first row

# to capture
iTop =  "image of the gray area above the first row"
iDigg = "image of a digg button"

# dimensions
hRow = 120 # height of a row
offButton = 30 # offset of confirm button

# find the top of matrix
mTop = find(iTop)
mTop.highlight(2)

# find all diggs in the row below and sort them left to right
mDiggs = mTop.below(hRow).findAll(iDigg)
mDiggs = sorted(mDiggs, key=lambda m:m.x)

# make something with every entry
for e in mDiggs:
    e.highlight(1)
    hover(e)
    wait(1)
    hover(e.below(offButton))

To test workflows, where something could happen by clicking, I first use hover instead and use the slow motion run.
Same goes for highlight: only of some help during testing.

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