Search code examples
rubywatirwatir-webdriver

Opening a browser in fullscreen mode using watir-webdriver


I know this is a very silly question. Yet, am not able to find how to make the browser open in fullscreen mode using watir webdriver. i tried using maximize() but in vain. This is how the code looks like:

require "rubygems"
require "watir-webdriver"
ff = Watir::Browser.new(:firefox)
ff.goto("http://google.com")
ff.maximize()

getting the error "undefined method maximize"


Solution

  • If you know screen size, you can move the browser to the top left corner and set it's size to screen size: Setting browser window size in Watir-webdriver.