Skip to content

Instantly share code, notes, and snippets.

@vidmantas
Created June 15, 2015 10:41
Show Gist options
  • Save vidmantas/a418a2f92dd57e5e5e8b to your computer and use it in GitHub Desktop.
Save vidmantas/a418a2f92dd57e5e5e8b to your computer and use it in GitHub Desktop.
module WatirHelper
def self.initialize_watir
profile = Selenium::WebDriver::Firefox::Profile.new
begin
profile.add_extension "./lib/support/selenium/JSErrorCollector.xpi"
rescue
p "Cannot add JSErrorCollector.xpi to profile"
end
profile['app.update.auto'] = false
profile['app.update.enabled'] = false
if ENV['FIREFOX_PATH']
Selenium::WebDriver::Firefox.path = ENV['FIREFOX_PATH']
end
driver = Selenium::WebDriver.for(:firefox, profile: profile)
Watir::Browser.new(driver)
end
end # WatirHelper
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment