Cucumber; Selenium WebDriver - how to use Google Chrome as the testing browser instead of Firefox
For capybara, add this to env.rb
Capybara.register_driver :selenium do |app| Capybara::Selenium::Driver.new(app, :browser => :chrome)end
Download the Chrome driver executable and copy it in you path, e.g. /usr/bin/ and make it executable
$ sudo chmod +x /usr/bin/chromedriver
Today the easiest way to get the chromedriver executable seem to be installing the chromedriver-helper gem. Please see https://github.com/flavorjones/chromedriver-helper for details.
Besides installing the gem you'll have to configure your environment the same way as already mentioned in several other answers:
Capybara.register_driver :selenium do |app| Capybara::Selenium::Driver.new(app, :browser => :chrome)end
If you're using capybara try this
Capybara.register_driver :selenium do |app|
Capybara::Selenium::Driver.new(app, :browser => :chrome)
end
See capybara docs for additional details (especially take a look into Configuring and adding drivers section)