correct me if I'm wrong, but generally if you have a "." in your reg exp it will match anything. So if you just put /icon_export.gif/ it *might* work if that is the only existing object. For example if you had two images, and they appear on your page in this order
icon_export_toSomewhere.gif icon_export.gif it will match the first one because the "." in /icon_export.gif/ means "anything". If you want to get to the 2nd image you should escape the dot: /icon_export\.gif/ I had a similar case where I had to escape the "." because of similar image names. Hope it works Shao On 7/8/05, Zeljko Filipin <[EMAIL PROTECTED]> wrote: > Try /icon_export.gif/ instead of /icon_export_gif/ > ________________________________ > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of > Tuyet Cong-Ton-Nu > Sent: Friday, July 08, 2005 9:36 PM > To: '[email protected]' > Subject: [Wtr-general] Choosing right attribute? > > > > > I can't seem to be able to find the right attribute to click on. I want to > click on the Export icon (image). This should work, but I got an error > > Another pair of eyes to look at this would really be appreciated: > > irb(main):030:0> > ie.frame("main").frame("header").image(:src, > /icon_export_gif/).click > > Watir::Exception::UnknownObjectException: Unable to locate > object, using src and > > (?-mix:icon_export_gif) > > from > C:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1979:in > `object_exist_check' > > from > C:/ruby/lib/ruby/site_ruby/1.8/watir.rb:2094:in `click' > > from (irb):30 > > > > Here is the View Source Code: > > <body onunload="closePopups()" class="mvaHeaderBody" > onLoad="JavaScript:onLoad(currentViewName);"> > > <table width="100%" height="100%" cellpadding=0 cellspacing=0 > border=0> > > <tr> > > <td align="left" > width="50%"> > > <table > height="100%" cellpadding=0 cellspacing=0 border=0> > > > <tr><td align="left"><b><nobr> Current > View: </nobr></b></td> > > > <td align="left"><b><nobr><input id="currentReport" name="currentReport" > value="" readonly size="48"/></nobr></b></td> > > > <td align="left"><b><nobr><input id="selectReport" name="selectReport" > type="button" value="..." > onClick="javascript:selectCustomReport()"/></nobr></b></td> > > > </tr> > > </table> > > </td> > > <td > width="50%"> </td> > > <td > align="right"> > > <table > height="100%" cellpadding="0" cellspacing="0" border="0"> > > > <tr> > > > <td align="right"> > > > <img src="/images/icon_export.gif" border="0" > onclick="javascript:onClickExport();" > > > alt="Export" > onMouseOver="window.status='Export'; return true"/> > > > </td> > > > <td valign="center"><a class="nav" > href="javascript:onClickExport();" > onMouseOver="window.status='Export'; return true" > > Export </a></td> > > > > > _______________________________________________ > 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
