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

前端 未结 6 2053
死守一世寂寞
死守一世寂寞 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:38

    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
    

提交回复
热议问题