Hi Joe 

Is this a complete copy of your html or have you edited it down?  ..  I 
don't think what you have posted is valid as I can't get the open & close 
tags to match up


What I would do is indent each child tag so that I can see clearly which 
tag is the direct parent of the cell I'm interested in.  I started with 
this :

<div id="main" style="padding: 10px">

   <table cellspacing="0" cellpadding="0">

    <tbody>

      <tr>

        <td align="left" style="vertical-align: top;">

           <table cellspacing="5" cellpadding="0">

            <tbody>

              <tr>

               <td align="left" style="vertical-align: top;">

                 
<table class="gwt-DecoratorPanel" cellspacing="0" cellpadding="0">


But came to a halt here as next is an end tag </td> but the table is still 
open (html is nested so this is bad) .   

If this is all the html, I'm surprised if it renders in a browser & have no 
idea how to automate it.

I there is more than you have posted try this exercise  .. indent each open 
tag below it's parent until you come to it's close tag.  

you should end up with something like:

<div>

  <table>

    <tbody>

      <tr>

        <td>

        </td>

      </tr>

    </tbody>

   </table>   

</div>

where each open tag has a close tag & they are all nested ..

Then work backward from the cell you want to build a unique id path  ..

You may end up with something like:

br.div(:id => "main").table(:index => 1).tr(:index => 0).td(:index => 1)  


Cheers

Anthony H




On Saturday, 1 September 2012 06:21:15 UTC+10, Joe Fl wrote:
>
> Hi Everyone,
>
> I am working on automating an GWT app for the first time.  I am trying to 
> get data from td tag in a 
> specific table .  
>
> When I run the following code:
>
> thr = br.div(:class,'middleCenterInner').trs
>
> I get the data from the first td.  I need to get to the second.
>
> Here the code:
>
> <div id="main" style="padding: 10px">
> <table cellspacing="0" cellpadding="0">
> <tbody>
> <tr>
> <td align="left" style="vertical-align: top;">
> <td align="left" style="vertical-align: top;">  ** I need to data from 
> this one.
> </tr>
> </tbody>
> </table>
> </div>
>
> You can see there is nothing useful to use to get there.  Most of the 
> useful tags in the these
> tds are the same.
>
> I did try using the index and that didn't workout.
> My Code:
> thr = br.td(:index,1).div(:class,'middleCenterInner').trs
>
> Any help would be greatly appreciated.
>
> Thank you,
> Joe
>

-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

[email protected]
http://groups.google.com/group/watir-general
[email protected]

Reply via email to