Quality is delighting customers
How to get row count of a Webtable using Selenium RC? Can any one reply to my question.
R,
Namrata
Tags:
String[] options = selenium.getSelectOptions("xField");
or
String[] options = selenium.getSelectedLabels("xField");
int count = options.length;
System.out.print(count);
Here is a table...
<table id="testRuns" border="0" valign="top" align="left" cellpadding=0 cellspacing=0 class="TABLE_section_bar2">
<tr valign="top">
<td valign="top" class="TD_tool_bar1"><b>First Row, First Column</b></td>
<td valign="top" class="TD_tool_bar1">
<select id="some_dynamic_value" multiple size=2 class="select_small">
<option value="0" selected>---<br>
<option value="1505_2557">R10.4_Preprod<br>
</select>
</td>
</tr>
<tr valign="top">
<td valign="top" class="TD_tool_bar1"><b>Second Row, First Column</b></td>
<td valign="top" class="TD_tool_bar1"><b>Second Row, Second Column</b></td>
</tr>
</table>
What you want to do is get the row count, like so...
selenium.getXpathCount("//table[@id='testRuns']//tr");
this should return 2
© 2021 Created by Quality Testing.
Powered by