Please try: element(:xxx, 'xxx').parent.element(:yyy, 'yyy') Thanks. Wesley Chen. For life, the easier, the better.
On Fri, Oct 30, 2009 at 9:09 AM, Jeff Fry <jeff....@gmail.com> wrote: > Hey all, > Remind me, is there a way in watir to navigate to the parent of an element? > I'm thinking of something like: > > #find text_field where value matches /foo/, go up to the <tr> that > contains it, and then within that <tr> click on the first <li> > browser.text_field(:value => /foo/).row(:parent).li(:index => 1).click > > I made up the .row(:parent) syntax in the above example. I'm just wondering > if there's real syntax to do the same thing...or if this is more of a > feature request? > > Cheers, > > -- > Jeff Fry > > http://testingjeff.wordpress.com > http://associationforsoftwaretesting.org > > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Watir General" group. To post to this group, send email to watir-general@googlegroups.com Before posting, please read the following guidelines: http://wiki.openqa.org/display/WTR/Support To unsubscribe from this group, send email to watir-general-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/watir-general -~----------~----~----~----~------~----~------~--~---