sikuli-driver team mailing list archive
-
sikuli-driver team
-
Mailing list archive
-
Message #20816
[Question #235440]: Region() example help
New question #235440 on Sikuli:
https://answers.launchpad.net/sikuli/+question/235440
Hi Sikuli Community
I have been at it for sometime trying to use the region() function in Sikuli and have referred to many example, unfortunately not complete but sort of get the idea.
Anyway what I am trying to do is test a program that has a scroll button, it is instructed to click a button until an image appears in a scroll box. The code below works but scans very slow, I have tried to insert examples from others into it but sadly can't get it to work...
===================================================================================================
#Test if the department sale button is there
if not exists("department.png"):
popup("Oops...!!! Check that you are on the sales menu")
exit(1)
else:
hover("department.png")
click()
#This is where I get stuck
def Region_with():
reg = Region(131,154,512,415) #This is the region I would like Sikuli to scan
reg.highlight(5) #This confirms it is looking at the area
#And this where I don't know how to tell "while not exists" to only scan in the area above
while not exists ("dept_list.png"):
click("scroll_btn.png")
click(getLastMatch())
else:
if exists("dept_list.png"):
click("ok_btn.png")
type("1000" + Key.ENTER)
wait("total_scrn.png")
===================================================================================================
What an awesome program, love how python is used and its teaching me more everyday.
--
You received this question notification because you are a member of
Sikuli Drivers, which is an answer contact for Sikuli.