Launching the Firefox browser using the Watir gem

Installation

Usage

require 'watir'
driver  = Selenium::WebDriver.for :firefox

browser = Watir::Browser.new(driver)

browser.driver.manage.timeouts.page_load = 30
browser.window.resize_to(1000, 600)
browser.window.move_to(0, 0)

## Observation

You should now observe a new Firefox browser window open at the top left hand corner of the screen.

Note: If you see the error message Selenium::WebDriver::Error::WebDriverError (unable to connect to Mozilla geckodriver 127.0.0.1:4444) exit from the IRB session and try again.

Resources