[Wtr-general] How to click a row from table in webpage

Cain, Mark Mark_Cain at RL.gov
Thu Jul 12 09:57:21 EDT 2007


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)
 
Third, the two 

      table[1][3].click

 

--Mark

 

 

________________________________

From: wtr-general-bounces at rubyforge.org
[mailto:wtr-general-bounces at rubyforge.org] On Behalf Of SHALINI GUPTA
Sent: Wednesday, July 11, 2007 11:06 PM
To: wtr-general at rubyforge.org; Wtr-general-request at rubyforge.org
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 <shalinigupta2006 at gmail.com> wrote: 

	Hi all,
	 
	Please tell me how to click a column of a row of a web page.
	 
	Regards
	
	shalini Gupta


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070712/7bb0abd1/attachment.html 


More information about the Wtr-general mailing list