通过Watir尝试加载网页时出现(Selenium::WebDriver::Error::WebDriverError))错误

3

获取(确保已安装Firefox或手动设置路径

Selenium::WebDriver::Firefox::Binary.path= (Selenium::WebDriver::Error::WebDriverError)) 

在通过Watir加载网页时遇到了问题。

我已经安装了最新版本的Firefox。 我正在尝试运行

$browser = Watir::Browser.new :firefox
$browser.goto("www.google.com")
$browser.text_field(:id, "gbqfq").set("zipcar\n")
1个回答

0

手动将路径添加到selenium-webdriver.rb。它位于Ruby路径下的gems文件夹中,在Windows中可能是这样的:

require 'selenium/webdriver'
Selenium::WebDriver::Firefox::Binary.path='C:\Users\default\Desktop\firefox'

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接