[Wtr-general] I am a newb

Cain, Mark Mark_Cain at RL.gov
Fri Sep 1 12:39:34 EDT 2006


When buttons all have the same names and id etc, you will need to use
$ie.button(:index, x).click where x is the 1-based index of the button
you want to click (from the top down).  So if there are 3 cancel buttons
on the page and you want to click the 2nd one then your code will look
like this:
	$ie.button(:index, 2).click

There are some really good examples of just about everything you would
want to do in the unittests directory installed when you install Watir.

Hope this helps,

--Mark

-----Original Message-----
From: wtr-general-bounces at rubyforge.org
[mailto:wtr-general-bounces at rubyforge.org] On Behalf Of David
Sent: Friday, September 01, 2006 9:11 AM
To: wtr-general at rubyforge.org
Subject: [Wtr-general] I am a newb

Ok so I just started using ruby and watir, when I say just started I
mean no programming experience. The company I work for has me
using/learning Watir. I can't make it click a button. I can make it
click other buttons though. The software we developed doesnt use buttons
per say, but something using href's and that such. I was wondering when
you tell watir to ie.link(:text, "Cancel").click , does it search the
page source for just cancel? We have several  so-called buttons named
cancel. Does watir just hit the first cancel? If so how do I make it hit
this specific cancel? Any thought are much appreciated.
---------------------------------------------------------------------
Posted via Jive Forums
http://forums.openqa.org/thread.jspa?threadID=3917&messageID=10762#10762
_______________________________________________
Wtr-general mailing list
Wtr-general at rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


More information about the Wtr-general mailing list