我在我的开发目录中安装了 geckodriver
ls | grep geckodriver
geckodriver
geckodriver-v0.11.1-linux64.tar.gz
我还导出到 $PATH 变量
export PATH=$PATH:~/Development/geckodriver
但是当我尝试在项目的 rails 控制台上初始化 webdriver 的实例时,我得到了这个
driver = Selenium::WebDriver.for :firefox
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 What's the issue here.
最佳答案
您有 selenium-webdriver-3.0.0.beta3.1 仅适用于 Firefox 48 及更高版本(尚未正常工作)。回退到 selenium-webdriver 版本 2.53.4 并重试。
也试试这个..
gem uninstall selenium-webdrivergem install selenium-webdriver -v 2.53.4关于ruby-on-rails - Ruby selenium webdriver 无法找到 Mozilla geckodriver,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41310586/