I think xpath is generally considered a last resort by most people.
To me it seems very brittle.  If the layout of your page changes a lot
of your code will break.  Using IDs to locate elements is usually your
best choice I believe.


On Jan 27, 12:07 pm, Bharath <bkalt...@gmail.com> wrote:
> Željko,
> Thank you very much.
> $browser.cell(:class=>'rptName').text worked for me.
> but i when I have time i will try to work with xpath.
>
> Thanks again
> BK
>
> On Wed, Jan 27, 2010 at 11:31 AM, Željko Filipin <
>
> zeljko.fili...@wa-research.ch> wrote:
> > On Wed, Jan 27, 2010 at 5:25 PM, Bharath <bkalt...@gmail.com> wrote:
> > > $browser.cell(:xpath, "//t...@class='rptName']/")
> > > Watir::Exception::UnknownObjectException: Unable to locate element, using
> > :xpath, "//t...@class='rptName']"
>
> > XPath is black magic to me. I rarely use it and I always have to look up
> > the syntax, and I do not have the time at the moment.
>
> > Try this:
>
> > browser.cell(:class => "rptName").text
>
> > If the cell is child of any element that could be uniquely identified, you
> > could use something like this:
>
> > browser.element(how => what).cell(:class => "rptName").text
>
> > Željko
>
> >  --
> > 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

-- 
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

Reply via email to