← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #233360]: How to use the location object

 

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

    Status: Open => Answered

RaiMan proposed the following answer:
reg = Region(x,y,w,h) # the region containing a column of checkboxes
cb = <captured image of a check box>

allCB = reg.findAll(cb) # finds all checkboxes in the region
# allCB contains all ckeckbox matches in a random order

allCBsorted = sorted(allCB, key=lambda m: m.y)
# now allCBsorted is a list of all checkbox matches in the region sorted top down

click(allCBsorted[5])
# will click the sixth (list indexes count from 0) checkbox from the top

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