← Back to team overview

sikuli-driver team mailing list archive

[Question #182237]: Does anybody know faster search method when the target is located below of the page?

 

New question #182237 on Sikuli:
https://answers.launchpad.net/sikuli/+question/182237

I am trying this case:
I opened facebook 
I can not see the jpg in current screen (cuz it is loacated under current screen/page)
then I want to find a jpg which is located down/below of the page.  

I wrote this code. It works perfect but does anybody know faster method?

Here is my code:

reg=Region(Region(274,100,526,605))

if reg.exists("ZLQQiu-1.png"):
    popup("Bravo")
    exit()
mouseMove("1323985068132-1.png")
mouseDown((Button.LEFT))
mouseLocation=Env.getMouseLocation()
dd=90

#Method-1
while not reg.exists("ZLQQiu.png"):
    mouseMove(Location(mouseLocation.x,(mouseLocation.y+dd)))  
    dd=dd+90
    if exists("ZLQQiu.png"):
        popup("Congrats!")
        exit()


#Method-2
#while not reg.exists("ZLQQiu.png"):
#    wheel(Location(mouseLocation),WHEEL_DOWN,3) 
#    if exists("ZLQQiu.png"):
#        popup("Congrats!")
#        break


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