On 8/16/11 4:51 AM, Željko Filipin wrote:
On Tue, Aug 16, 2011 at 12:20 AM, Dmitriy Korobskiy <dkro...@gmail.com
<mailto:dkro...@gmail.com>> wrote:
> I'm somewhat stumped trying to select the second table out of
multiple identical tables on the page in Watir 2.0.1. It should be
simple, right?
Please note that `:index => 1` in Watir 1.x means the first table, and
in Watir 2.x means the second table.
Sure. I'm using 2.0.1 and I need the second table.
Please post HTML of the tables.
Željko
Here is the relevant fragment. The target table is highlighted in bold.
<table width="1000" cellpadding="0" cellspacing="0" border="0"
align="center" bgcolor="#ffffff">
<tr>
<td align="left" valign="top" class="content_bg"><img
src="images/point.gif" width="1" height="1" border="0"></td>
<td align="left" valign="top">
<!-- InstanceBeginEditable name="Content" -->
<table cellpadding="0" cellspacing="0" border="0" align="center"
width="95%">
<tr>
<td colspan="3" align="left" valign="top"><img src="images/point.gif"
width="1" height="15" border="0" /></td>
</tr>
<tr>
<td colspan="3" align="left" valign="top" class="headertxt">My Open
Carts</td>
</tr>
<tr>
<td colspan="3" align="left" valign="top"><img src="images/point.gif"
width="1" height="11" border="0" /></td>
</tr>
<tr>
<td colspan="5" align="left" valign="middle"><a
href="cartAction.cfm?action=new"><img src="images/new_cart_bt.gif"
alt="New Cart" width="90" height="24" border="0" /></a></td>
</tr>
<tr>
<td align="left" valign="top">
<table class="tablesorter data"
cellpadding="5" cellspacing="1" style="width:950px;">
<thead>
<tr>
<th class="smalltxt" width="300px">Cart Name</th>
<th class="smalltxt" width="150px">Created Date</th>
<th class="smalltxt" width="150px">Last Updated Date</th>
<th class="smalltxt" width="200px">Actions</th>
<th class="smalltxt" width="100px">Status</th>
</tr></thead>
<tbody>
<tr>
<td class="row1"><a
href="cartAction.cfm?action=select&cartId=KorobskiyD_110714135613"
class="link1">KorobskiyD_110714135613</a></td>
<td class="row1">Jul 14, 2011 1:56 PM</td>
<td class="row1">Jul 29, 2011 11:34 AM</td>
<td class="row1"><a
href="cartAction.cfm?action=submit&cartId=KorobskiyD_110714135613"
class="link1"><img src="./images/submit_icon_n.gif" title="Submit Cart"
alt="Submit Cart" border="0" hspace="4"></a> <a
href="deleteConfirmation.cfm?cartId=KorobskiyD_110714135613"
class="link1"><img src="./images/delete_icon_n.gif" title="Delete Cart"
alt="Delete Cart" border="0" hspace="4"></a> <a
href="cartHistory.cfm?cartId=KorobskiyD_110714135613" class="link1"><img
src="./images/cart_history_icon.gif" title="Cart History" alt="Cart
History" border="0" hspace="4"></a></td>
<td class="row1">Open</td>
</tr>
<tr>
<td class="row1"><a
href="cartAction.cfm?action=select&cartId=KorobskiyD_110816050326"
class="link1">KorobskiyD_110816050326</a></td>
<td class="row1">Aug 16, 2011 5:03 AM</td>
<td class="row1">Aug 16, 2011 5:03 AM</td>
<td class="row1"><a
href="deleteConfirmation.cfm?cartId=KorobskiyD_110816050326"
class="link1"><img src="./images/delete_icon_n.gif" title="Delete Cart"
alt="Delete Cart" border="0" hspace="4"></a> <a
href="cartHistory.cfm?cartId=KorobskiyD_110816050326" class="link1"><img
src="./images/cart_history_icon.gif" title="Cart History" alt="Cart
History" border="0" hspace="4"></a></td>
<td class="row1">Open</td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td colspan="3" align="left" valign="top"><img src="images/point.gif"
width="1" height="29" border="0" /></td>
</tr>
<tr>
<td colspan="3" align="left" valign="top" class="headertxt">My Submitted
Carts</p></td>
</tr>
<tr>
<td align="left" valign="top">
*<table class="tablesorter data"
align="left" cellpadding="5" cellspacing="1"
style="width:950px;" border="0">
<thead><tr>
<th class="smalltxt" width="300px">Cart Name</th>
<th class="smalltxt" width="150px">Created Date</th>
<th class="smalltxt" width="150px">Last Updated Date</th>
<th class="smalltxt" width="200px">Actions</th>
<th class="smalltxt" width="100px">Status</th>
</tr></thead>
<tbody>
<tr>
<td class="row1"><a href="cart.cfm?cartId=KorobskiyD_110712121510"
class="link1">KorobskiyD_110712121510</a></td>
<td class="row1">Jul 12, 2011 12:15 PM</td>
<td class="row1">Jul 14, 2011 1:54 PM</td>
<td class="row1"><a
href="cartHistory.cfm?cartId=KorobskiyD_110712121510" class="link1"><img
src="./images/cart_history_icon.gif" title="Cart History" alt="Cart
History" border="0" hspace="4"></a></td>
<td class="row1">Submitted to NBS</td>
</tr>
<tr>
<td class="row1"><a href="cart.cfm?cartId=TEST" class="link1">TEST</a></td>
<td class="row1">Jun 26, 2011 8:57 PM</td>
<td class="row1">Aug 16, 2011 5:01 AM</td>
<td class="row1"><a href="cartAction.cfm?action=export&cartId=TEST"
class="link1"><img border="0"
hspace="4"src="./images/download_spread_i.gif" title="Download
Spreadsheet" alt="Download Spreadsheet"></a> <a
href="cartHistory.cfm?cartId=TEST" class="link1"><img
src="./images/cart_history_icon.gif" title="Cart History" alt="Cart
History" border="0" hspace="4"></a></td>
<td class="row1">Spreadsheet Generated</td>
</tr>
</tbody>
</table>*
</td>
</tr>
</table><br/><br/>
<!-- InstanceEndEditable -->
</td>
<td align="left" valign="top" class="content_bg"><img
src="images/point.gif" width="1" height="1" border="0"></td>
</tr>
</table>
--
DK
AIM: DKroot1, Skype: DKroot
--
Before posting, please read http://watir.com/support. In short: search before
you ask, be nice.
watir-general@googlegroups.com
http://groups.google.com/group/watir-general
watir-general+unsubscr...@googlegroups.com