locked
Html Inner Text property is rendered differently in VS 2012 than VS 2010? RRS feed

  • Question

  • I have several tests that get the innertext value of an htmltable on a web page and compare that string against an expected value. These tests were created in VS 2010 and have run successfully in several release cycles of our product. For the latest release I am running these tests using VS 2012 and am finding that when I compare the strings for equality <Assert.AreEqual(expected, actual)> the asssertion is failing. After some debugging I found that

    1. The strings are the same e.g. Expected is "abc123", Actual is "abc123"

    2. The character arrays have the same characters in the same order

    3. The byte arrays retrieved by the code below are completely different. I assume that is why the Assertion is failing.

    Has anyone else seen this? How did you resolve the issue?

    Thanks very much,

    Thursday, December 13, 2012 12:54 AM

Answers

  • The assert functionality should be working seamlessly across VS 2010 and VS2012 versions and any test created in VS2010 should not be failing on 2012.

    The innerText, however, is know to be different across browsers and browser versions, have you changed your IE browser version recently?

    • Marked as answer by OneHip51 Tuesday, December 18, 2012 6:30 PM
    Friday, December 14, 2012 2:50 PM

All replies

  • Hi OneHip51,

    Thank you for posting in the MSDN forum.

    If possible, please share us the detailed error message, please enable tracing for the UI test to get more useful message.

    As far as I know, the VS2012 would support the coded UI test created in the VS2010, but to make sure that it is not related to this test, you could try to record a new coded UI test for it in VS2012, check it again. In addition, you could add assert for the control which you want to check, and then make sure that this specific property value doesn’t be changed. Maybe you could copy the actual value, and then paste it for the expected value. Hope it could help.

    Best Regards,


    Jack Zhai [MSFT]
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Friday, December 14, 2012 10:05 AM
    Moderator
  • The assert functionality should be working seamlessly across VS 2010 and VS2012 versions and any test created in VS2010 should not be failing on 2012.

    The innerText, however, is know to be different across browsers and browser versions, have you changed your IE browser version recently?

    • Marked as answer by OneHip51 Tuesday, December 18, 2012 6:30 PM
    Friday, December 14, 2012 2:50 PM
  • I did not know that the inner text varied with the browser version. Thanks. It is very likely that I created these tests in IE 7 or 8 and I am now running them in IE 9.

    Tuesday, December 18, 2012 6:33 PM