Cucumber; Selenium WebDriver - how to use Google Chrome as the testing browser instead of Firefox

前端 未结 6 2061
死守一世寂寞
死守一世寂寞 2020-12-23 15:02

For a Cucumber scenario on my Rails 3.1 app, I used the @javascript tag, so Selenium is activated. I get the following error:

Could not find Firefox binary (         


        
6条回答
  •  醉酒成梦
    2020-12-23 15:43

    Capybara.default_driver = :chrome
    Selenium::WebDriver::Chrome::Service.executable_path = '/usr/local/bin/chromedriver' # specify the path of chromedriver
    Capybara.register_driver :chrome do |app|
      Capybara::Selenium::Driver.new(app, :browser => :chrome)
    end
    

提交回复
热议问题