Željko,
Thanks for referring to the firefox addon I was able to get the xpath for
the text element i'm trying to get.
Here is how it looks
/html/body/form/table/tbody/tr[2]/td/table/tbody/tr/td[3]/table/tbody/tr[2]/t...@class='rptName'
and position()=2]/text()
I tried using the second option you suggested but I cant use that as the
tables have no attributes and that is why I thought Xpath would be the best
option.
here is what i have tried so far
$browser.cell(:xpath, "//t...@class='rptName']/")
and that returns
Watir::Exception::UnknownObjectException: Unable to locate element, using
:xpath, "//t...@class='rptName']"
    C:/ruby/lib/ruby/gems/1.8/gems/watir-1.6.5/lib/watir/element.rb:56:in
`assert_exists'
    C:/ruby/lib/ruby/gems/1.8/gems/watir-1.6.5/lib/watir/element.rb:119:in
`to_s'
    FI_16_FI_Login_Sanity.rb:182:in `puts'
    FI_16_FI_Login_Sanity.rb:182:in `test_i_runAllClientReports'
    FI_16_FI_Login_Sanity.rb:169:in `each'
    FI_16_FI_Login_Sanity.rb:169:in `test_i_runAllClientReports'

Can you please let me know if i'm doing the right thing?

Thanks again.
BK

2010/1/27 Željko Filipin <[email protected]>

> On Wed, Jan 27, 2010 at 3:58 PM, BK <[email protected]> wrote:
> > The HTML looks like this   - <td nowrap="" class="rptName">TEXT I NEED
> > TO CAPTURE</td>
> > How should I use xpath to get that text or to verify if that text
> > exists?
>
> Why do you insist on using xpath if you do not know how to use it?
>
> Without xpath, you could do something like (if you want to be specific):
>
> browser.div(how => what).table(how => what).row(how => what).cell(how =>
> what).text
>
> If you are interested in xpath:
>
> http://wiki.openqa.org/display/WTR/XPath
> https://addons.mozilla.org/en-US/firefox/addon/1192
>
> Željko
> --
> watir.com - community manager
> watirpodcast.com - host
>
>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Watir General" group.
> To post to this group, send email to [email protected]
> Before posting, please read the following guidelines:
> http://wiki.openqa.org/display/WTR/Support
> To unsubscribe from this group, send email to
> [email protected]
> 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 [email protected]
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/watir-general

Reply via email to