Selenium webdriver无法找到Mozilla geckodriver

时间:2017-03-04 12:53:34

标签: ruby-on-rails selenium firefox rspec

gem selenium-webdriver 3.2.2

FF 51.0.1(64位)

OS Ubuntu 16.04

我没有运行测试,得到错误。

Selenium::WebDriver::Error::WebDriverError:
    Unable to find Mozilla geckodriver. Please download the server from https://github.com/mozilla/geckodriver/releases and place it somewhere on your PATH. More info at https://developer.mozilla.org/en-US/docs/Mozilla/QA/Marionette/WebDriver.

我建立了geckodriver 1.14.0,但错误仍然存​​在。

1 个答案:

答案 0 :(得分:3)

将它放在你的Gemfile

# Gemfile
gem 'geckodriver-helper'

然后在您的spec_helper文件中

Capybara.register_driver :selenium do |app|
  Capybara::Selenium::Driver.new(app, browser: :firefox)
end