If you have more than one link with 'Cancel' as the text -- it probably is grabbing a different one is you use ie.link(:text, 'Cancel').click
In that case you need to uniquely identify it, and may need to use the index. Try this: get the page to where this link exists open a command prompt run irb and put in the following to connect to your browser instance require 'watir' include 'Watir' ie=IE.attach(:title, /title of your browser window/) ie.show_links try to figure out which one is your link you can do ie.link(:index, index_number).flash to try to flash different ones to help you identify it, once you know the index then ie.link(:index, index_number).click should work I'd think hope this helps > -----Original Message----- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of David > Sent: Friday, September 01, 2006 1:06 PM > To: [email protected] > Subject: Re: [Wtr-general] I am a newb > > Apparently I need more help than thought. I have tried all of > the ideas every one has given me(thank you). I am still > unclear on how to use index or flash method. The button or > link I am trying to get to, I have done many others just like > it, but for some reason I cant get it to press cancel this > time. I have been using ie.link(:text, "Export Data").click > format, but I figure the one I am trying to do watir is > grabbing one of the first Cancel's in the source. In the ruby > prompt, it will go through and act like everything went > smoothly. It is laid out the same way as others, but I dont know. > --------------------------------------------------------------------- > Posted via Jive Forums > http://forums.openqa.org/thread.jspa?threadID=3917&messageID=1 > 0779#10779 > _______________________________________________ > Wtr-general mailing list > [email protected] > http://rubyforge.org/mailman/listinfo/wtr-general > The content contained in this electronic message is not intended to constitute formation of a contract binding TWTC. TWTC will be contractually bound only upon execution, by an authorized officer, of a contract including agreed terms and conditions or by express application of its tariffs. This message is intended only for the use of the individual or entity to which it is addressed. If the reader of this message is not the intended recipient, or the employee or agent responsible for delivering the message to the intended recipient, you are hereby notified that any dissemination, distribution or copying of this message is strictly prohibited. If you have received this communication in error, please notify us immediately by replying to the sender of this E-Mail or by telephone. _______________________________________________ Wtr-general mailing list [email protected] http://rubyforge.org/mailman/listinfo/wtr-general
