[Ironruby-core] Watir under IronRuby Error

Qwerty Qwerty lists at ruby-forum.com
Thu Aug 27 11:47:37 EDT 2009


Ok, so after hacking watir.rb, I managed to get IE to open and navigate 
to the URL, but then using the following basic script:

 require 'watir'                         # use watir gem
 test_site = 'http://www.google.com'     # set a variable
 b = Watir::IE.new                  # open the IE browser
 b.goto(test_site)                       # load url, go to site
 b.text_field(:name, "q").set("pickaxe") # load text "pickaxe" into 
search field named "q"
 b.button(:name, "btnG").click           # "btnG" is the name of the 
Search button, click it

 if b.text.include?("Programming Ruby")
   puts "Test Passed. Found the test string: 'Programming Ruby'."
 else
   puts "Test Failed! Could not find: 'Programming Ruby'"
 end


I now get the following error:

./watir/element.rb:54:in `assert_exists': Unable to locate element, 
using :name, "q" (Watir::Exception::UnknownObjectException)
        from ./watir/element.rb:288:in `enabled?'
        from ./watir/element.rb:60:in `assert_enabled'
        from ./watir/input_elements.rb:328:in `set'
        from Simplewatirscript.rb:6

-- 
Posted via http://www.ruby-forum.com/.


More information about the Ironruby-core mailing list