[Wtr-general] Unable to click on links with the same text

2007-07-02 Thread Lavanya Lakshman
Following is my sample script :


Title of page


This is my first homepage. This text is bold
Text to be displayed
Text to be displayed

 


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")
ie.link(:text => '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 (  ) 
(Watir::Exception::MissingWayOfFindingObjectException)
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
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


Re: [Wtr-general] Unable to click on links with the same text

2007-07-03 Thread Lavanya Lakshman
I will revise my html file to make it more clear:


Title of page


This is my first homepage. This text is bold
http://www.google.co.in";>url
http://www.google.co.in";>url



To answer both of your question, 
a) I am using latest version of Watir 1.4.1
b) while trying to access using href also i get the same error:
c:/ruby/lib/ruby/gems/1.8/gems/watir-1.4.1/./watir.rb:963:in `getLink': {:text=>
"url", :index=>2} is an unknown way of finding a link (  ) (Watir::Exception::Mi
ssingWayOfFindingObjectException)
from c:/ruby/lib/ruby/gems/1.8/gems/watir-1.4.1/./watir.rb:2830:in `init
ialize'
from c:/ruby/lib/ruby/gems/1.8/gems/watir-1.4.1/./watir.rb:570:in `new'
from c:/ruby/lib/ruby/gems/1.8/gems/watir-1.4.1/./watir.rb:570:in `link'

from E:/PROVIS/sample.rb:16
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


Re: [Wtr-general] Unable to click on links with the same text

2007-07-03 Thread Lavanya Lakshman
Thanks Zelijko!!!
It worked :)
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


[Wtr-general] Receiving extensive warning messages while trying to run Watir Ruby scripts

2007-07-04 Thread Lavanya Lakshman
I have installed 1.8.5 version of ruby along with 1.4.1 version of Watir before 
and didnt have any issues, until recently I was required to have a completely 
new setup on a different machine. 

Ruby I have installed from (http://rubyforge.org/frs/?group_i d=167) 1.8.25-21 
version. 

While running any of the Watir scripts, I am receiving the following warning 
messages:

E:\PROVIS>GlobalAdminScript.rb
c:/ruby/lib/ruby/gems/1.8/gems/watir-1.4.1/./watir.rb:1039: warning: already ini
tialized constant REVISION
c:/ruby/lib/ruby/gems/1.8/gems/watir-1.4.1/./watir.rb:1042: warning: already ini
tialized constant VERSION
c:/ruby/lib/ruby/gems/1.8/gems/watir-1.4.1/./watir.rb:1045: warning: already ini
tialized constant READYSTATE_COMPLETE
c:/ruby/lib/ruby/gems/1.8/gems/watir-1.4.1/./watir.rb:1048: warning: already ini
tialized constant DEFAULT_TYPING_SPEED
c:/ruby/lib/ruby/gems/1.8/gems/watir-1.4.1/./watir.rb:1051: warning: already ini
tialized constant DEFAULT_SLEEP_TIME
c:/ruby/lib/ruby/gems/1.8/gems/watir-1.4.1/./watir.rb:1054: warning: already ini
tialized constant DEFAULT_HIGHLIGHT_COLOR
c:/ruby/lib/ruby/gems/1.8/gems/watir-1.4.1/./watir.rb:1901: warning: already ini
tialized constant TO_S_SIZE
c:/ruby/lib/ruby/gems/1.8/gems/watir-1.4.1/./watir.rb:2217: warning: already ini
tialized constant TAG
c:/ruby/lib/ruby/gems/1.8/gems/watir-1.4.1/./watir.rb:2225: warning: already ini
tialized constant TAG
c:/ruby/lib/ruby/gems/1.8/gems/watir-1.4.1/./watir.rb:2232: warning: already ini
tialized constant TAG
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


[Wtr-general] Recovery System in WATIR

2007-07-04 Thread Lavanya Lakshman
Hi All, 

Whenever we consider any tool for automation, the first and the foremost 
critical part is the recovery system. 

Unfortunately I didn't get much info related to this on the website. 

I would appreciate your thoughts and experience related to this. 


Thanks and Regards,
Lavanya Lakshman
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


Re: [Wtr-general] Receiving extensive warning messages while trying to run Watir Ruby scripts

2007-07-08 Thread Lavanya Lakshman
HI, 

Guess u had the rite point. 

I was using watir with a different case. 

Thx
Lavanya
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


Re: [Wtr-general] Recovery System in WATIR

2007-07-08 Thread Lavanya Lakshman
I would appreciate if you could give more inputs on the features?
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


Re: [Wtr-general] Reading Static data

2007-07-09 Thread Lavanya Lakshman
I had a similar problem and contains_text did work for me.
ie.contains_text("file successfully added")
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


Re: [Wtr-general] "Exist" method is avaliable in WATIR

2007-07-09 Thread Lavanya Lakshman
if (ie.link(:text, "Hello").exists?)
 puts "the text link exists"
else
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


Re: [Wtr-general] need help on Data Driven

2007-07-10 Thread Lavanya Lakshman
Try the following 

Category is holding an array and not just  a single variable. Thereby each 
value needs to be picked up and then assigned. 

category.each do |cat|
ie.text_field(:name,"ctl00$ContentPlaceHolder1$txtCategory").set(cat.to_s)
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


Re: [Wtr-general] Selecting controls in a dialog box

2007-07-10 Thread Lavanya Lakshman
Step 1:
Since it is a dialog box, Attach the focus to this page by using the following:
ie = Watir::IE.attach(:title, "Web Page Dialog")

Step 2:
Do a puts ie.show_all_objects 
This will give the various objects and their identification attributes. 

Step 3:
Based on the above output, perform the regular text field entry and click 
button operation.
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general