我正在尝试让 firewatir 在 Mac OSX Leopard 上运行。我安装了 Firefox 3.6rc2,但运行最简单的脚本不起作用:
require 'rubygems'
require 'firewatir'
ff=FireWatir::Firefox.new
ff.goto("http://mail.yahoo.com")
我收到以下错误
/usr/local/lib/ruby/gems/1.8/gems/firewatir-1.6.5/lib/firewatir/firefox.rb:237:in `set_defaults': Unable to connect to machine : 127.0.0.1 on port 9997. Make sure that JSSh is properly installed and Firefox is running with '-jssh' option (Watir::Exception::UnableToStartJSShException)
from /usr/local/lib/ruby/gems/1.8/gems/firewatir-1.6.5/lib/firewatir/firefox.rb:131:in `initialize'
from ./watir-test.rb:12:in `new'
from ./watir-test.rb:12
即使我尝试使用 -jssh 选项启动 Firefox,我也会收到一个错误(尽管是另一个错误)
/Applications/Firefox.app/Contents/MacOS/firefox-bin -jssh
在这种情况下的错误输出:
/usr/local/lib/ruby/gems/1.8/gems/firewatir-1.6.5/lib/firewatir/firefox.rb:125:in `initialize': Firefox is running without -jssh (RuntimeError)
是否有任何教程或 hnt 可以让 firewatir 在 Mac OSX 上实际运行?