Setting browser window size in Watir-webdriver

Alastair Montgomery picture Alastair Montgomery · May 25, 2011 · Viewed 14k times · Source

How can you specify the size of the browser window opened when you call the following with watir-webdriver?

browser = Watir::Browser.new(:firefox)

Answer

Željko Filipin picture Željko Filipin · May 25, 2011

This works only for Firefox at the moment:

browser.window.resize_to(800, 600)

and you can move the browser, too:

browser.window.move_to(0, 0)