How to get a final sorted match list after more than one findAll()
Hi Rainman, hope I'm not abusing, this is the most difficult script I would ever dare to make, I made a kinda pseudocode, hope you could help me. Thanks Advanced.
I have a little 330 x 600 px window (it can't be resized) inside chrome, inside a flash website, with this inside...
* __ idxxx __ somename
idxxy __ anothername
idxxz __ anewname
* __ idxyx __ yetsomename
idxyy __ yetanothername
* __ idxyz __ yetanewname
idyxx __ andyetsomename
* __ idyyx __ andyetanothername
idyzx __ andyetanewname
It is a table listing some names, with a scrollbar at the right side (cuz the list is larger than 9 names), also some names have at their left side a "StarImage" (represented by starsign) that are either orange or black.
I would like to count from top to bottom how many "StarImages" are no matter if they are orange or black, any of both colors count as one. (eg. if there are 3 black and 3 orange, then are 6 in total)
Then I would like to create a variable named...
toclickonVar = 2
So if "toclickonVar = 2" I will click on the second "StarImage" found from top to bottom.
But if for example "toclickonVar = 6" and the total "StarImage" count was 4 (like in example table above), so ImageCount < "toclickonVar" then I will like to subtract ImageCount from "toclickonVar" and then press the PageDown key and the Down key (in order to scroll down), then count again how many "StarImages" are from top to bottom and click on the new(current) "toclickonVar" if it still is greater than the new(current) "StarImages" count, then repeat the steps described in this paragraph from the beginning to the end. (I guess this paragraph is a kindof loop)
Is this possible? I thought about the easiest way to achive this, if you got better idea pls correct me. So far I have write this...
App.focus("Chrome")
Settings.
Settings.
Settings.
hover(Pattern(
mouseDown(
count = 0
try:
matches = list(findAll(
count = len(matches)
except FindFailed:
pass #nothing to do
print "found:", count
if count > 0:
sortedMatches = sorted(matches, key=lambda m:m.y) # sorts top to bottom
hover(
mouseUp(
You helped me with this code, but this only count one type of images, I need to find two colors of StartImages, I either don't know how to click on second, third, forth. Thanks Advanced again man.
Question information
- Language:
- English Edit question
- Status:
- Solved
- For:
- SikuliX Edit question
- Assignee:
- No assignee Edit question
- Last query:
- Last reply: