使用ruby 1.9.3和最新版本的watir-webdriver我在运行测试脚本时遇到以下错误:
C:/.../ selenium / webdriver / firefox / binary.rb:120in'path':找不到Firefox二进制文件(os-windows) . 确保使用Selenium :: Webdriver :: Firefox :: Binary.path =手动安装Firefox或设置路径
除了当前版本之外,我刚安装旧版本的firefox后才开始出现此错误 . 我正在使用watir-webdriver NOT selenium webdriver . 这是我的要求
require 'highline/import'
require 'watir-webdriver'
require 'win32console'
require 'term/ansicolor'
require 'base64'
这行错误:
browser = Watir::Browser.new :ff
我卸载了所有版本的firefox和Ruby,并重新安装了最新版本 . firefox安装目录在我的PATH中 . 提前感谢任何想法 .
2 回答
在我的“要求”部分之后添加了这一行并且它有效
尝试这一点,采取安装mozilla exe的路径 .