Created
June 15, 2015 10:41
-
-
Save vidmantas/a418a2f92dd57e5e5e8b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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