Skip to content

Instantly share code, notes, and snippets.

@carlosantoniodasilva
Created October 22, 2010 11:08
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save carlosantoniodasilva/640361 to your computer and use it in GitHub Desktop.
Save carlosantoniodasilva/640361 to your computer and use it in GitHub Desktop.
Configure User Agent for selenium webdriver in Capybara
# 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
@Nuru
Copy link

Nuru commented Sep 6, 2013

As of Capybara 1.0.0 Capybara::Driver::Selenium is wrong. It has been changed to Capybara::Selenium::Driver

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment