Selenium::WebDriver::Error::WebDriverError。无法找到chromedriver。请从以下地方下载服务器

问题描述 投票:0回答:1

使用ruby 2.4.0p0 , Rails 5.2.3。

在运行rails应用的系统测试用例时出现错误。

Error:
SubscriptionsTest#test_visit_susbcription:
Selenium::WebDriver::Error::WebDriverError: Unable to find chromedriver. Please download the server from
https://chromedriver.storage.googleapis.com/index.html and place it somewhere on your PATH.
More info at https://github.com/SeleniumHQ/selenium/wiki/ChromeDriver.

我的系统测试是这样的。

require "application_system_test_case"

    class SubscriptionsTest < ApplicationSystemTestCase
      test "visit susbcription" do
        visit subscriptions_url
      end
    end

请提示可能的解决方法。 运行系统测试的命令。

RAILS_ENV=test rails test -v test/system/subscriptions_test.rb
ruby-on-rails-5 selenium-chromedriver ruby-2.4
1个回答
0
投票

这个问题可以通过在 gemfile 中添加以下 gem 来解决。

gem 'webdrivers', '~> 4.0'
© www.soinside.com 2019 - 2024. All rights reserved.