Watir Script has some issue with Classic Gem
Hi I'm new to Ruby and Watir
I have installed Ruby1.9.3 and Watir3.0.0.
This is my Ruby Script
require 'rubygems'
require 'watir'
browser = Watir::IE.new
browser.set_slow_speed
browser.goto 'http://google.com'
puts 'Opened Browser'
browser.text_field(:name, 'q').set "Watir"
puts 'Entered Search Text'
browser.button(:name, 'btnG').click
puts 'Search button'
time=Time.now.to_s
puts time
browser.link(:text, 'Watir').click
Output:
C:\Ruby193\bin>ruby googlesearch.rb
Opened Browser
Entered Search Text
Search button
2012-06-13 10:40:16 +0530
C:/Ruby193/lib/ruby/gems/1.9.1/gems/watir-classic-3.0.0/lib/watir-classic/elemen
t.rb:66:in `assert_exists': Unable to locate element, using
{:tag_name=>["a"], :
text=>"Watir"} (Watir::Exception::UnknownObjectException)
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/watir-classic-3.0.0/lib/watir-c
lassic/element.rb:414:in `perform_action'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/watir-classic-3.0.0/lib/watir-c
lassic/element.rb:269:in `click!'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/watir-classic-3.0.0/lib/watir-c
lassic/element.rb:211:in `click'
from googlesearch.rb:13:in `<main>'
I dont know whats happening please help...
2 Posted by Sophia on 13 Jun, 2012 05:42 AM
Hi.... Can anyone tell me what the problem is??? Why was it closed???
Support Staff 3 Posted by Luis Lavena on 13 Jun, 2012 12:06 PM
Your question is about watir, while this website provides support for
rubygems and rubygems.org, not gems.
Please direct your questions yo watir developers.