This is a migrated thread and some comments may be shown as answers.

HtmlTable element doesnot return correct tbody rows

1 Answer 73 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
ravi
Top achievements
Rank 1
ravi asked on 20 Sep 2010, 11:13 AM

Hi,
There is table in a page, It has more that 1 rows. rows are displayed in TBody tag. but the Tbody, TR and TD's are not closed.
I have written code to retrieve table rows count , once have the rowcount i can select specific row from the row count. but when I try to retrieve row count, the row count is given as 1 and the value in the last TD from last Tbody is retrieved always.

My page has below code for table

<table width="100%" class="datatable' id="detailtable" >
<tbody>
<tr>
<td>
<td>
<td>
<td>
<tbody>
<tr>
<td>
<td>
<td>
<td>
<tbody>
<tr>
<td>
<td>
<td>
<td>
</table>


1 Answer, 1 is accepted

Sort by
0
Nikolai
Telerik team
answered on 21 Sep 2010, 11:10 AM
Hello ravi,

The reason you are no getting the correct row count is the fact that our HTML parser cannot find where your TBody, TR and TD closing tags are. Since the parsing is not successful the information presented is not accurate. In general every html element should be either self closing or have a closing tag. The example below in considered as a "bad" html and although the browser is not throwing errors such html creates a huge problems not only for automation but also for CSS styles and DOM manipulating JavaScript functions.

The only work around I can think of here is to add JS function in your page that will return the correct row count or other row information you may need and called it from your test.

Hope this helps.

Greetings,
Nikolai
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
General Discussions
Asked by
ravi
Top achievements
Rank 1
Answers by
Nikolai
Telerik team
Share this question
or