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

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

    try putting the path of chrome drivers in your PATH variable if you are on a linux distro with bash.

    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

    this worked for me

提交回复
热议问题