我有一个在 Firefox 中运行良好的脚本。
该脚本不在 Internet Explorer 中运行。我将不胜感激。
这是前几行:
require 'rubygems'
require 'watir'
require 'watir-webdriver'
require 'test/unit'
URL = "http://google.com/"
class TestGoogle < Test::Unit::TestCase
def setup
#@browser = Watir::Browser.new :firefox
@browser = Watir::Browser.new :ie
end
def testSignInLink
@browser.goto URL
以下是选定的错误消息:
C:\Ruby193\bin\ruby.exe -e $stdout.sync=true;$stderr.sync=true;load($0=ARGV.shift) C:/RubymineProjects/ditto/Google_01_TU_03.rb
C:/Ruby193/lib/ruby/gems/1.9.1/gems/watir-classic-3.7.0/lib/watir-classic/version.rb:3: warning: already initialized constant VERSION
...
...
1) Error:
testSignInLink(TestGoogle):
TypeError: superclass mismatch for class UnknownObjectException
C:/Ruby193/lib/ruby/gems/1.9.1/gems/watir-classic-3.7.0/lib/watir- classic/exceptions.rb:12:in `<module:Exception>'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/watir-classic-3.7.0/lib/watir- classic/exceptions.rb:2:in `<module:Watir>'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/watir-classic-3.7.0/lib/watir-classic/exceptions.rb:1:in `<top (required)>'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/watir-classic-3.7.0/lib/watir-classic.rb:6:in `require'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/watir-classic-3.7.0/lib/watir-classic.rb:6:in `<top (required)>'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/watir-4.0.2-x86-mingw32/lib/watir/loader.rb:48:in `require'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/watir-4.0.2-x86-mingw32/lib/watir/loader.rb:48:in `load_driver'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/watir-4.0.2-x86-mingw32/lib/watir/loader.rb:40:in `load_driver_for'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/watir-4.0.2-x86-mingw32/lib/watir/loader.rb:8:in `new'
C:/RubymineProjects/ditto/Google_01_TU_03.rb:11:in `setup'
第 11 行是:
@browser = Watir::Browser.new :ie