← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #151077]: nearby example for windows 7

 

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

    Status: Answered => Solved

Rudiger Wolf confirmed that the question is solved:
Brilliant. Thanks for your advice. I now have it working.
I uploaded a YouTube video of my efforts to help others.

http://www.youtube.com/watch?v=ayIprfBWOAk


def highlightregion(myRegion):
	""" Used to hightlight a region so we know where Sikuli is looking."""
	for i in range(2):
		myRegion.highlight(1)
		wait(0.5)
	return

setShowActions(True)  #Enable target circiles for debuging
myApp=App("Firefox") #Look for open App with the Firefox in title
myApp.focus() #Make sure app gets focus

#Maximize browser window
type(" ", KEY_ALT) # Open windows sizing control
wait(1)
type("x") # Maximize the window

type("l", KEY_CTRL) # switch to address field
paste("http://www.letscollaborate.co.za/Resource-Centre/ResearchDocuments/Forms/AllItems.aspx";)
type(""+Key.ENTER)
wait(3) # Wait for the website to load

mTL=hover( ) # My Target Line
mTR = getLastMatch().nearby(20).right() # Expand the Target area by 20 pixels and look to the roight of the screen
highlightregion(mTR) #Make the region visible for debuging
mTR=mTR.find( )
lookInRegion=mTR.nearby(200) #Create a region to limit activity to
highlightregion(lookInRegion) #Make the region visible for debuging
lookInRegion.click(mTR,3) #Click on the dropdown button
lookInRegion.wait( ) # Wait for the drop down menu
lookInRegion.hover( ) # Hover over the menu, we expect a cascading menu to appear
lookInRegion.click( ,3) # Click on the download menu

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