无法连接到 chromedriver [英] unable to connect to chromedriver

查看:95
本文介绍了无法连接到 chromedriver的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用水豚 &selenium 测试我的 Rails 项目.当我执行测试脚本时,它有这样的错误

I use capybara & selenium test my rails project. when i execute the test script,it's has errors likes this

 Selenium::WebDriver::Error::WebDriverError:
   Could not find Firefox binary (os=macosx). Make sure Firefox is installed or set the path manually with Selenium::WebDriver::Firefox::Binary.path=

我谷歌 如何使用 Google Chrome 作为测试浏览器而不是 Firefox

但它发生其他错误,如

Selenium::WebDriver::Error::WebDriverError:
   unable to connect to chromedriver http://127.0.0.1:9515

推荐答案

我遇到了完全相同的问题.对我有用的是使用webdrivers".宝石.我的 gemfile 的一部分看起来像这样:

I had the exact same issue. What worked for me was using the "webdrivers" gem. Part of my gemfile looks like this:

group :development, :test do
  gem 'rspec-rails'
  gem 'capybara'
  gem 'webdrivers'
end

这篇关于无法连接到 chromedriver的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆