examining strings as html RRS feed

  • Question

  • User1080785583 posted

    When I do simple things in a unit test I would like my simple things to look like something useful. There has been some issues with examining strings as "HTML" in the debugging windows for visual studio. I am wondering when I use the "HTML VISUALIZER" if there is a way to view the page in an actual "browser".

    I ask because I write some test code that does not use the browser.

    How can I simulate a browser when I hover over variable and select "HTML Visualizer"?

    Here is an example

    var rendered = "<html><head><script type='text/javascript'>alert('hi');</script></head><body>stuffed</body></html>"

    when I inspect the variable rendered, I can look at it in a few ways ["Text","Html","Json","xml"]. the HTML version is pretty weak imo

    Thanks in advance.

    Friday, April 8, 2016 2:30 PM

All replies

  • User-166373564 posted


    How can I simulate a browser when I hover over variable and select "HTML Visualizer"?

    Generally I use Jquery to display string as HTML, like:

    str = "hello, <b>my name is</b> jQuery.",
      html = $.parseHTML( str ),

    For HTML Visualizer, I don't have much experience about it.



    Monday, April 18, 2016 8:51 AM
  • User1080785583 posted

    I am building html/script on the server and would like a way to say that this string is well formed html.

    I can live without examining the javascript on the server but would like to be able to say something that lets TypeScript analyze my javascript code.

    Tuesday, April 19, 2016 6:32 PM
  • User1080785583 posted

    I have found that if you right click on the html and click properties inside of the html visualizer within a unit test, that the file is actually generated and saved to the localhost at this addess..   file:///C:/Users/avecmoi/AppData/Local/Temp/VSD1.tmp.HTM#

    What would stop me to say, Assert.RunHtml(file:///C:/Users/avecmoi/AppData/Local/Temp/VSD1.tmp.HTM#)  and have this picked up by some agent and execute a webrequest or something?

    Thursday, April 21, 2016 6:56 PM
  • User1080785583 posted

    If anyone is still following, my test has shown me some more information that could perhaps allow me to truly grasp 'html examiner'.

    new System.Collections.Generic.Mscorlib_DictionaryDebugView<string, string>(viewModelFunctionList).Items[0].Value

    Anyone know what this is?

    Tuesday, April 26, 2016 7:18 PM