← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #191125]: fix size of browser

 

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

EdEd proposed the following answer:
This isn't the exact code I use (removed some cruft so I may have
introduced a typo or two) but you get the idea.   I resize to the
"smallest" screen size, of all the computers I run my tests from, and do
all my image captures from there, to ensure they will all be pretty
similar, no matter which machine runs my testing scripts.


if Env.isWindows():
	App.open('"C:\\Program Files (x86)\\Mozilla Firefox\\firefox.exe" "http://www.browserstack.com";')
	wait(10)
	regi = App.focusedWindow()
	centerBlueBar = Location( regi.x + int(regi.w / 2), regi.y+15)
	toZero = Location( int(regi.w / 2), 15)
	dragDrop(centerBlueBar, toZero)
	wait(1)
	loc = Location(regi.w - 3, regi.h - 3)
	locB = Location(1021, 690)
	dragDrop(loc, locB)
	wait(1)
else:
	App.open('Firefox "http://www.browserstack.com";')
	wait(10)
	App.focus('Firefox')
	wait(1)
	regi = App.focusedWindow()
	centerBlueBar = Location( regi.x + int(regi.w / 2), regi.y+15)
	toZero = Location( int(regi.w / 2), 21+15)
	dragDrop(centerBlueBar, toZero)
	wait(1)
	loc = Location(regi.w - 3, regi.h + 17)
	locB = Location(1021, 21 + 690)
	dragDrop(loc, locB)
	wait(1)
	addr = Location(regi.w / 2, 21 + 40)
	click(addr)
	paste("http://www.browserstack.com";)
	type(Key.ENTER)
	wait(5)

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