In the case of many td's with the class "x" or "Y", if the value
you're looking for remains in static position on the page, you can use
the index number to find it and draw out the value.  Unfortunately if
the page code ever changes, you're at serious risk for uncovering the
wrong value and in the worst case, it wouldn't break your script so
you'd be none-the-wiser.

With WWW::Mechanize and Hpricot/Nokogiri, I got used to using xpath to
find the element I'm looking for and verify it that way -- it looks
like you can do that with Watir now, too: 
http://wiki.openqa.org/display/WTR/XPath

This is also when I'd try to get with the developer to see if he could
change the css classes or add a name/alt/etc to help me locate that
specific element.

On Dec 15, 10:12 am, tester86 <sagar.am...@gmail.com> wrote:
> Sorry please ingore my previous message, the syntax provide work fine
> but I am trying to debuy nested tables as I have another row with the
> same class name but different value. When I use the same syntax inside
> an if statement it fails? I looked at the API but could not find any
> good documentation?
>
> On Dec 14, 7:43 pm, Wesley Chen <cjq....@gmail.com> wrote:
>
> > Do you want assert $ie.cell(:class, "x").text.eql?("90") ?
>
> > Thanks.
> > Wesley Chen.
> > For life, the easier, the better.
>
> > On Tue, Dec 15, 2009 at 6:25 AM, tester86 <sagar.am...@gmail.com> wrote:
> > > I have a table that has a sub class
>
> > > <td class = "table x">
> > > <tr>
> > > <td class ="Y">
> > >  <td class ="x">90</td>
> > > </tr>
>
> > > I want to perform a validation check where it will read the data
> > > between the tags and pass or fail depending on the value. I searched
> > > the group and internet but could not see anything. Does anyone have
> > > any ideas.
>
> > > --
> > > 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-Hide quoted text -
>
> > - Show quoted text -

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