Forum: Ruby Row count of table

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
0c4708fefcee1aa993710e4cc65b6b6f?d=identicon&s=25 Vani K. (vanivk)
on 2007-08-07 15:55
Hello all,
I am stuck up in finding the row count of a table in a HTML page through
Watir script. I am using row_count() function to find the number of rows
in the table. Its returning me incorrect number of rows in the table. I
tried accessing the table through xpath, since I did not have attribute
associated with the table. Following is the HTML of the table [obtained
through IE developer bar] whose row count I need:

<TD id="ctl00_ContentPlaceHolder1_dtGridEmployees_dom"
style="VERTICAL-ALIGN: top; HEIGHT: 47px">
  <TABLE style="WIDTH: 100%" cellSpacing="0" cellPadding="0" border="0">
        <TR id="ctl00_ContentPlaceHolder1_dtGridEmployees_top_head">
        <TR class="Row"

The row_count() for the table inside the <TD> gives as 9, instead of 2.
I am using the following xpath :

Am I going wrong anywhere? Please let me know.

Paul Rogers (Guest)
on 2007-08-07 19:05
(Received via mailing list)
On Aug 7, 7:56 am, Vani Kulkarni <> wrote:
>   <TABLE style="WIDTH: 100%" cellSpacing="0" cellPadding="0" border="0">
>   </TABLE>
> Vani
> --
> Posted via

you should post this to the watir group (
I think the problem you are having is because of nested tables

This topic is locked and can not be replied to.