mutiple choices problem sikuli

Asked by aakash

i am facing a strange problem i have multiple choices and want to click digg and confirm of the same set
How to do this in sikuli

see Here
http://i1215.photobucket.com/albums/cc507/shelbie36/1-1.jpg

i wanna click of same set it is clicking confirm of another set

Question information

Language:
English Edit question
Status:
Answered
For:
SikuliX Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
RaiMan (raimund-hocke) said :
#1

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.

Revision history for this message
RaiMan (raimund-hocke) said :
#2

The above script is based on your screenshot, so things might have to be adjusted in real world.

Revision history for this message
aakash (shelbiesmith1121) said :
#3

it is just selecting the grey area

i want it to click digg button and then click conform of the same section

Revision history for this message
RaiMan (raimund-hocke) said :
#4

send me your script and screenshots zipped to my mail at https://launchpad.net/~raimund-hocke

but you have to wait - see faq 1739

Revision history for this message
aakash (shelbiesmith1121) said :
#5

hrow = 120
offbutton = 30

how did you find the value 120 and 30 please let me know ?

i want to change it as script is not working

Revision history for this message
RaiMan (raimund-hocke) said :
#6

look faq 1686

Mostly, it is some measure/guess-try-adjust-loop. (with rc3 now, the Preview Target Offset tab is usable again for measuring pixel distances).

If it is for real serious stuff, you should measure some key offsets, margins and other dimensions and assign them to variables with speaking names, like I tried to do above.

Can you help with this problem?

Provide an answer of your own, or ask aakash for more information if necessary.

To post a message you must log in.