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

OuterMarkup returns different value from different Internet Explorer versions

3 Answers 57 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Andrei
Top achievements
Rank 1
Andrei asked on 28 May 2014, 01:54 PM
Hi,

the following code returns different results when running on IE11 and IE9:

String test = Find.ByXPath("//tr/td[contains(text(), 'Education')]").As<HtmlControl>().BaseElement.OuterMarkup;
Manager.Log.WriteLine("OuterMarkup is: " + test);

IE11 (and FireFox):
[Trace] : OuterMarkup is: <td scope="row">Education</td>

IE9:
[Trace] : OuterMarkup is: <TD scope=row>Education</TD>

So assert on OuterMarkup fails when running on different machines.
Page itself has "<td scope="row">Education</td>" value - test is a modified one from the test suite that comes together with the framework.

You can download this sample project here.
Latest framework version is used (2014.1.410.0).

Can you please comment on this issue ?

3 Answers, 1 is accepted

Sort by
0
Ivaylo
Telerik team
answered on 02 Jun 2014, 08:17 AM
Hello Andrei,

Please excuse me for the delayed reply.
Just for your information the archive you provided is broken, so I am not able to extract it. However I might not need to since the issue you are describing seems to be browser specific and not depending on Test Studio at all. What is returned as an Outer Markup should be exactly what the browser renders. Out of Test Studio just check how the different browsers display the Outer Markup.


Thank you for your understanding.

Regards,
Ivaylo
Telerik
 
Quickly become an expert in Test Studio, check out our new training sessions!
Test Studio Trainings
 
0
Andrei
Top achievements
Rank 1
answered on 02 Jun 2014, 12:30 PM
Hello Ivaylo,

you can try to download the project from different link.

Attached you can find screenshots of what IE browser shows when inspecting this element - and both IE9/IE11 show the same code.

Is what browser renders different from what it shows in page code section?

Thank you,
Andrei
0
Ivaylo
Telerik team
answered on 03 Jun 2014, 01:00 PM
Hello Andrei,

I have investigated this a bit further. It is indeed related to a different browser behavior. TestStudio’s OuterMarkup call internally asks the browser for the markup using the innerHTML and outerHTML property of the element.
As you can see from the screenshot attached, the markup returned from the browser call changes between IE9 and IE11; note the quotation marks around the scope=row value and the fact that the tag TD is now in uppercase like in your case.

The reason for this change in IE’s behavior is described in this MSDN Blog post. Basically, in IE10 or later, the “quirks” mode starts behaving more like the quirks mode of browsers like Firefox.

In order to work interoperably with IE9,  you should either have to update the markup (so that it’s not running in Quirks mode, or is forced to legacy Quirks Mode) or change their logic in the assertion to handle the different results across browsers.


Thank you for your understanding.

Regards,
Ivaylo
Telerik
 
Quickly become an expert in Test Studio, check out our new training sessions!
Test Studio Trainings
 
Tags
General Discussions
Asked by
Andrei
Top achievements
Rank 1
Answers by
Ivaylo
Telerik team
Andrei
Top achievements
Rank 1
Share this question
or