環境:
Ruby 1.8.7 (2011-02-18 patchlevel 334)[i386-mingw32]
Firebug 1.7.3
Firefox 3.6.18
Firefox已安裝jssh-3.6-WINNT.xpi套件
先前有安裝過RailsInstaller
狀況:出現 錯誤訊息 (如下)
c:\Ruby187\bin\rspec_tutorial>ruby watir_example.rb
C:/RailsInstaller/Ruby1.8.7/lib/ruby/gems/1.8/gems/firewatir-1.9.2/lib/firewatir
/jssh_socket.rb:19:in `js_eval': this.docShell is null
(JsshSocket::JSTypeError)
from C:/RailsInstaller/Ruby1.8.7/lib/ruby/gems/1.8/gems/firewatir-1.9.2/
lib/firewatir/firefox.rb:194:in `set_browser_document'
from C:/RailsInstaller/Ruby1.8.7/lib/ruby/gems/1.8/gems/firewatir-1.9.2/
lib/firewatir/firefox.rb:45:in `initialize'
from C:/RailsInstaller/Ruby1.8.7/lib/ruby/gems/1.8/gems/commonwatir-1.9.
2/lib/watir/browser.rb:65:in `new'
from C:/RailsInstaller/Ruby1.8.7/lib/ruby/gems/1.8/gems/commonwatir-1.9.
2/lib/watir/browser.rb:65:in `new'
from watir_example.rb:4
我是ruby新手,照著watir的example照作
做出現了以下的錯誤訊息,小弟我看不懂
請教版上高人該如何解決?
附錄:
原始碼如下:
require 'rubygems'
require 'watir'
require 'firewatir'
browser = Watir::Browser.new
browser.goto("http://bit.ly/watir-example")
browser.text_field(:name => "entry.0.single").set "Watir"
browser.text_field(:name => "entry.1.single").set "I come here from
Australia. \n The weather is great here."
browser.radio(:value => "Watir").set
browser.radio(:value => "Watir").clear
browser.checkbox(:value => "Ruby").set
browser.checkbox(:value => "Python").set
browser.checkbox(:value => "Python").clear
browser.button(:name => "logon").click
browser.select_list(:name => "entry.6.single").clear
puts browser.select_list(:name => "entry.6.single").options
browser.select_list(:name => "entry.6.single").select "Chrome"
browser.button(:name => "submit").click
puts browser.text.include? "Your response has been recorded."
puts browser.title == "Thanks!"
google查詢了一下,似乎也有人有相同的情況?
http://wiki.openqa.org/display/WTR/Watir+in+5+Minutes
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 210.242.211.152
→
07/27 09:49, , 1F
07/27 09:49, 1F
Ruby 近期熱門文章
PTT數位生活區 即時熱門文章