On 9/1/06, David <[EMAIL PROTECTED]> wrote:
Ok so I just started using ruby and watir, when I say just started I mean no programming experience.


Welcome!
 

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.

So I have several suggestions:

Use "view source" to look at the HTML in the page.  All of the clickable things should have a value "id=foo".  Use id to identify page elements to Watir whenever possible. 

Download Microsoft's Internet Explorer Developer's Toolbar here: http://www.microsoft.com/downloads/details.aspx?familyid=e59c3964-672d-4511-bb3e-2d5e1db91038&displaylang=en
It allows you to easily see things about all of the elements on the page. 

Finally, we like helping newbs, but it is immensely helpful when you ask this sort of question to have both your Watir code and the HTML of the page element that you are trying to manipulate. 

Finally, Watir is a little ambiguous sometimes about what it considers a button and what it considers a link.  If "ie.link(:text, "Cancel").click" doesn't work, try "ie.button(:text, "Cancel").click"




_______________________________________________
Wtr-general mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/wtr-general

Reply via email to