Cain, Mark
Thu, 12 Jul 2007 07:04:03 -0700
sorry sent it by mistake before i was done... Third, the two sets of brackets are column and row respectively so count the '<tr>' tags (also 1-based) until you get to the desire column and then count the '<td>' begining at the desired column (<tr> tag) until you get to the desired row (also 1-based). e.g. table[1][3].click (click column 1 row 3) You may need to tweek around with this a bit. You can use the flash method to zero in on you target area. Hope this helps,
--Mark
________________________________
From: Cain, Mark
Sent: Thursday, July 12, 2007 6:57 AM
To: 'wtr-general@rubyforge.org'
Subject: RE: [Wtr-general] How to click a row from table in webpage
First off, Tables currently support only two attributes in Watir 'id'
and 'index'. Since the Table in your does not use the 'id' attribute
you must supply the proper index. To identify what is the proper index
for this particular table do a 'View Source' on the web page you want to
use. Do a 'ctrl + f' and in the ' Find' dialog that pops up type
'<table' and Click Next. NOTE: the index attribute in 1-based so count
the number of time you click the next button until you get to the
desired table in your page and that is the table index you will
use--kind of kludgy I know.
Second, you will need to assign the desired table to a variable so:
table = $ie.table(:index, 8)
--Mark
________________________________
From: [EMAIL PROTECTED]
[EMAIL PROTECTED] On Behalf Of SHALINI GUPTA
Sent: Wednesday, July 11, 2007 11:06 PM
To: wtr-general@rubyforge.org; [EMAIL PROTECTED]
Subject: Re: [Wtr-general] How to click a row from table in webpage
this is the HTML of that table...
table class="DataTable " cellspacing="0">
<tbody>
<tr id="m3236 " class="RowHeaderStyle">
<th class="Value "> Object/Context </th>
<th class="Hide "> CAST Maintainability </th>
<th class="Value "> CAST Maintainability </th>
<th class="Hide "> Variation </th>
<th class="Value "> Variation </th>
<th class="Value "/>
</tr>
<tr id="m3237 " class="RowLevel1Style">
<td class="RowLevel1 ">
</td>
<td class="Hide "> 2.72 </td>
<td class="medium "> High Risk </td>
<td class="Hide "> 0 </td>
<td class="Value ">
</td>
<td class="Value ">
</td>
</tr>
<tr id="m3238 " class="RowLevel2Style" style="display: table-row;">
<td class="RowLevel2 ">
<a onmouseout="javascript:HideTooltip(); "
onmouseover="javascript:ShowTooltip('Access detailed quality and
quantity assessment page for the selected component.'); " href="
http://localhost:8080/CASTAD/?snapshot=2&treeobject=12507&object=12507&f
rame=FRAME_PORTAL_TOP_LEVEL_DETAILS
<http://localhost:8080/CASTAD/?snapshot=2&treeobject=12507&object=12507&
frame=FRAME_PORTAL_TOP_LEVEL_DETAILS> "> New applicationTEST2 </a>
</td>
<td class="Hide "> 2.72 </td>
<td class="medium "> High Risk </td>
<td class="Hide "> 0 </td>
<td class="Value ">
</td>
<td class="Value ">
</td>
</tr>
<tr id="m3239 " class="RowLevel1Style">
</tr>
<tr id="m3240 " class="RowLevel2Style" style="display: none;">
</tr>
</tbody>
</table>
On 7/12/07, SHALINI GUPTA <[EMAIL PROTECTED]> wrote:
Hi all,
Please tell me how to click a column of a row of a web page.
Regards
shalini Gupta
_______________________________________________ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general