Internet Explorer outerHTML and innerHTML missing closing tags on table objects <th> and <td>
I am trying to convert HTML tables to XML, but when performing the conversion on a Table object in IE, I get an error about tags not matching. The function I'm running is:
while True: if (ReportObj.VisibleOnScreen == True): XMLdoc = Sys.OleObject["Msxml2.DOMDocument.6.0"] xmlstring = ReportObj.outerHTML XMLdoc.loadXML(xmlstring) # This is the part of the function throwing the error below return XMLdoc
The exact error in TestComplete is: End tag 'tr' does not match the start tag 'th'
In Chrome, FF, and Edge this function works fine, only IE gives me the problem. After some digging, I've tracked it down to the outerHTML and innerHTML properties not returning the closing </th> or </td> on the table in TestComplete, which is what is breaking the XML conversion.
After the </button> tag it should have a </th> tag. I've inspected the element in IE and verified that it includes the </th> tag.
<th style="width: 7.69%;">Plan Name <button uib-tooltip-html="tipPlanName" tooltip-trigger="mouseenter click" tooltip-class="help-swui">?</button>
When I run the same thing in Chrome, it returns correctly:
<th style="width: 7.69231%;">Plan Name <button uib-tooltip-html="tipPlanName" tooltip-class="help-swui" tooltip-trigger="mouseenter click">?</button></th>
Does anyone know why I can't get the closing tags to show properly in TestComplete?
Solved! Go to Solution.
We managed to find a solution.
THAT's an interesting piece to know... Thanks for sharing. We're currently not coding HTML5 applications but, when and if we do, I'll store this bit for later.
[Hall of Fame]
Please consider giving a Kudo if I write good stuff
Why automate? I do automated testing because there's only so much a human being can do and remain healthy. Sleep is a requirement. So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.
Mysterious Gremlin Master
Vegas Thrill Rider