Skip to content

Instantly share code, notes, and snippets.

@timlinquist
Created February 29, 2012 01:02
Show Gist options
  • Save timlinquist/1936685 to your computer and use it in GitHub Desktop.
Save timlinquist/1936685 to your computer and use it in GitHub Desktop.
Use default profile w/selenium webdriver
# Excerpt from features/env.rb for customizing selenium to be ran via capybara
.......
require 'cucumber/rails'
require 'selenium-webdriver'
# Use default profile for Firefox
# By default, selenium uses an anonymous profile so none of your settings will be enabled
# It is smart to setup a 'selenium' or 'test' profile to reduce the configurations you
# would set as a normal user of Firefox.
#
# Setting up profiles in Firefox: http://support.mozilla.org/en-US/kb/Profiles
#
# Also a list of supported browsers for selenium-webdriver:
# - Android
# - Chrome
# - Firefox
# - IE
# - IPhone
# - Opera
Capybara.register_driver :custom_selenium do |app|
Capybara::Selenium::Driver.new(app, :browser => :firefox, :profile => 'default')
end
Capybara.default_driver = :custom_selenium
.....
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment