Željko's solution is probably your best option. :) You can also access any of those three cells using XPath - here is a way that should work in IE and Firefox:
browser.cell(:xpath, "//td[.='Three']") The dot being compared to 'Three' represents the text of the cell. And if the cell text has leading or trailing whitespace, you can strip it from the text before doing the comparison: browser.cell(:xpath, "//td[normalize-space(.)='Three']") Thanks Bill On Thu, May 6, 2010 at 8:08 AM, Željko Filipin < [email protected]> wrote: > On Thu, May 6, 2010 at 4:58 PM, tjp <[email protected]> wrote: > > <td id="zippy">One</td> > > <td id="zippy">Two</td> > > <td id="zippy">Three</td> > > How do I refer to the third one? > > Not tested, but should work: > > browser.cell(:text => "Three") > > or > > browser.cell(:id => "zippy", :text => "Three") > > Željko > -- > watir.com - community manager > pledgie.com/campaigns/2982 - donate to Watir > watirpodcast.com - host > testingpodcast.com - audio podcasts on software testing. all of them > > > -- > Before posting, please read http://watir.com/support. In short: search > before you ask, be nice. > > You received this message because you are subscribed to > http://groups.google.com/group/watir-general > To post: [email protected] > To unsubscribe: > [email protected]<watir-general%[email protected]> > -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. You received this message because you are subscribed to http://groups.google.com/group/watir-general To post: [email protected] To unsubscribe: [email protected]
