Created
October 22, 2010 11:08
-
-
Save carlosantoniodasilva/640361 to your computer and use it in GitHub Desktop.
Configure User Agent for selenium webdriver in Capybara
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
# Re-register selenium driver to be able to pass in the profile option, overriding the user agent. | |
Capybara.register_driver :selenium do |app| | |
require 'selenium/webdriver' | |
profile = Selenium::WebDriver::Firefox::Profile.new | |
profile['general.useragent.override'] = 'FooBar' | |
Capybara::Driver::Selenium.new(app, :profile => profile) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
As of Capybara 1.0.0 Capybara::Driver::Selenium is wrong. It has been changed to Capybara::Selenium::Driver