Set Chrome as Default Browser for RSpec/Capybara
if I remember correctly:
I downloaded latest chromedriver
from this resource https://code.google.com/p/selenium/wiki/ChromeDriver
Then insert in spec_helper.rb
Capybara.register_driver :chrome do |app| Capybara::Selenium::Driver.new(app, :browser => :chrome)endCapybara.javascript_driver = :chrome
and it worked for me
Add this gem to Gemfile
to install and update chromedriver.
gem "chromedriver-helper", "1.0.0"
See https://github.com/flavorjones/chromedriver-helper. The bugs listed in comments to previous answers have been fixed.
Then add this to spec_helper.rb
:
Capybara.register_driver :selenium do |app| Capybara::Selenium::Driver.new(app, browser: :chrome)end
That's it.
Add gem "chromedriver-helper"
to Gemfile and run bundle
Also include this lines of code below into you spec_helper.rb
outside Rspec.configure
block.
Capybara.register_driver :selenium do |app| Capybara::Selenium::Driver.new(app, browser: :chrome)end
Most importantly, do not forget to require 'capybara'
in the spec_helper.rb
This will solve the problem. :)