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

Erroneous DOM in WebAii for combination of nested table and an (empty) <td /> tag

3 Answers 43 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Peter Lenz
Top achievements
Rank 1
Peter Lenz asked on 14 Jun 2010, 10:35 AM
Hi,
the combination of nested table and an (empty) <td /> tag empty table cell
causes my test fails in IE8 due to a wrongly interpreted DOM.

The source DOM is found in code1 the result after asking Webaii for the DOM ist listed in code2.
The row with the "td3" tag slips out of the outer table of the nested two ones.

This is observed when asking WebAii for parts of or the whole DOM by e.g.
- Find.ByNodeIndexPath("1") --> returns the root element which relates to a wrong XML structure as serialized in code2
- Find.ByNodeIndexPath("1/0/0/1") --> returns NULL when searching for the second row in the outer table.

When observing the DOM in IE DEveloper Tools the correct DOM is shown (as seen in the attached screenshot of my IE)!
The same test with FireFox as the defult browsers is sucessfull!

Html code contains an nested table with an empty, self closing td tag (this html code is generated by our WebApplication Framework so I have almost no control over the html generation.

Here the htlm souce (code1):
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> 
<html  xmlns="http://www.w3.org/1999/xhtml">   
  <head> 
    <title> 
      Test  
    </title> 
  </head> 
  <body> 
    <table> 
      <tbody> 
        <tr> 
          <td> 
            <table> 
              <tbody> 
                <tr> 
                  <td />                <!-- the problem cell --> 
                  <td id="td2">cell 1,1,1,2</td> 
                </tr> 
              </tbody> 
            </table> 
          </td> 
        </tr> 
        <tr> 
          <td id="td3">cell 2,1</td> 
        </tr> 
      </tbody> 
    </table> 
  </body> 
</html> 

html code of the DOM structure (serialized) as returned by Find.ByNodeIndexPath("1")
<body> 
    <table> 
        <tbody> 
            <tr> 
                <td> 
                    <table> 
                        <tbody></tbody>  
                    </table> 
                </td> 
                <tr> 
                    <td> 
                        <td id='td2'></td> 
                    </td> 
                </tr> 
            </tr> 
        </tbody> 
    </table> 
    <tr> <!-- ROW slipped out of outer table --> 
        <td id='td3'></td> 
    </tr> 
</body> 

Thank you for your support -

Peter Lenz

3 Answers, 1 is accepted

Sort by
0
Missing User
answered on 14 Jun 2010, 11:00 PM
Hi Peter,

Thanks for the post, and this is actually a known issue.

So I understand this may cause some problems with certain finds in the framework, but could you still use Find.ById() or by text content like:

HtmlTableCell c = ActiveBrowser.Find.ByExpression<HtmlTableCell>("textcontent=cell 1,1,1,2");

Greetings,
Nelson Sin
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.
0
Peter Lenz
Top achievements
Rank 1
answered on 15 Jun 2010, 09:11 AM
Hi Nelson,

you are right, I still can get a special element using an appropiate method.
Unfortunatly in my test I often have to navigate across the DOM using Parent, ChildNodes, GetNextSibling and so on.

For example, if I wantet to get the outer table element started from the cell "td2" I would use code like: 

HtmlTableCell cell = ActiveBrowser.Find.ByExpression<HtmlTableCell>("textcontent=cell 1,1,1,2");  
HtmlTable outerTable = cell.Parent<HtmlTableRow>().Parent<HtmlTable>().Parent<HtmlTableCell>().Parent<HtmlTableRow>().Parent<HtmlTable>(); 

But this fails because the DOM built by the Framewok does not correspond to the html source in the browser (IE8).

Do you know if this issue is going to be fixed eventually?

Best Greetings
Peter Lenz 
0
Missing User
answered on 17 Jun 2010, 11:36 PM
Hi Peter,

I rechecked the logged bug, but unfortunately, I cannot give you a definite time table on when it will be looked at. We will look to have this addressed in a future release of the Framework.

Regards,
Nelson
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
Peter Lenz
Top achievements
Rank 1
Answers by
Missing User
Peter Lenz
Top achievements
Rank 1
Share this question
or