← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #355875]: how to use FindAll in a loop

 

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

    Status: Open => Answered

RaiMan proposed the following answer:
--- I understand that the findAll function will return all locations of the images found
read: http://sikulix-2014.readthedocs.io/en/latest/region.html#Region.findAll

--- your code:

count = 0
findAll("checkbox")
for x in findAll("checkbox"): # apparently only one checkbox is found
    while count < 5: # this loops 5 times with the same x
        click(x)
        count = count +1

--- how to use
checkboxes = list(findAll("checkbox")) # all found unsorted
print len(checkboxes) # get the number found
for box in checkboxes: # loop through all found
    print box

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