Following is my sample script :
<title>Title of page</title>
This is my first homepage. <b>This text is bold</b>
<a href="url">Text to be displayed</a>
<a href="bcd">Text to be displayed</a>

Now as per Watir syntax, I am trying to click on link 2: 
# This allows test script to use Watir tool
require 'watir'
require 'watir/watir_simple.rb'
include Watir
include Test::Unit::Assertions
ie = Watir::IE.attach(:title, "Title of page") => 'Text to be displayed', :index  => 2).click

Upon execution, I am getting the following error:
c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:963:in `getLink': {:index=>2, :text=>"Te
xt to be displayed"} is an unknown way of finding a link (  ) 
        from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:2830:in `initialize'
        from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:570:in `new'
        from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:570:in `link'
        from E:/PROVIS/sample.rb:10
Wtr-general mailing list

Reply via email to