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: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of David
Sent: Friday, September 01, 2006 9:11 AM
To: [email protected]
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
[email protected]
http://rubyforge.org/mailman/listinfo/wtr-general
_______________________________________________
Wtr-general mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/wtr-general

Reply via email to