<p>Have just started using Visual Studio Professional's built-in unit testing features, which as I understand, uses MS Test to run the tests.</p>

<p>The .trx file that the tests produce is xml, but was wondering if there was an easy way to convert this file into a more "manager-friendly" format?</p>

<p>My ultimate goal is to be able to automate the unit-testing and be able to produce a nice looking document that shows the tests run and how 100% of them passed  :)</p>

[{'answer_id': 23473, 'author': 'Espo', 'author_id': 2257, 'author_profile': 'https://Stackoverflow.com/users/2257', 'pm_score': 4, 'selected': True, 'text': '<p>Since this file is XML you could and should use xsl to transform it to another format. The <em>IAmUnkown</em> - blog has an entry about <a href="http://preetsangha.blogspot.com/2008/05/decoding-ms-test-trx-file.html" rel="noreferrer">decoding/transforming the trx file into html</a>. </p>\n\n<p>You can also use <a href="http://boss.bekk.no/display/BOSS/.NetSpecExporter" rel="noreferrer">.NetSpecExporter from Bekk</a> to create nice reports. Their product also uses XSL, so you could probably <em>steal</em> it from the downloaded file and apply it with whatever xsl-application you want.</p>\n'}, {'answer_id': 289473, 'author': 'Preet Sangha', 'author_id': 30225, 'author_profile': 'https://Stackoverflow.com/users/30225', 'pm_score': 2, 'selected': False, 'text': '<p>If your are using VS2008 I also have an answer on <a href="http://preetsangha.blogspot.com/2008/06/decoding-vs2008-trx-file.html" rel="nofollow noreferrer">IAmUnknown</a>. Which updates the above answer which is based on VS 2005 trx format</p>\n\n<p>here is a style sheet that creates a readable HTM  file</p>\n\n<pre><code>&lt;xsl:stylesheet version="2.0"  \n                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"\n                xmlns:t="http://microsoft.com/schemas/VisualStudio/TeamTest/2006"\n                &gt;\n\n&lt;xsl:template match="/"&gt;\n  &lt;html&gt;\n  &lt;head&gt;\n        &lt;style type="text/css"&gt;\n            h2 {color: sienna}\n            p {margin-left: 20px}\n            .resultsHdrRow { font-face: arial; padding: 5px }\n            .resultsRow { font-face: arial; padding: 5px }\n            &lt;/style&gt;\n    &lt;/head&gt;\n  &lt;body&gt;\n    &lt;h2&gt;Test Results&lt;/h2&gt;\n    &lt;h3&gt;Summary&lt;/h3&gt;\n        &lt;ul&gt;\n            &lt;li&gt;Tests found:    &lt;xsl:value-of select="t:TestRun/t:ResultSummary/t:Counters/@total"/&gt;&lt;/li&gt;\n            &lt;li&gt;Tests executed: &lt;xsl:value-of select="t:TestRun/t:ResultSummary/t:Counters/@executed"/&gt;&lt;/li&gt;\n            &lt;li&gt;Tests passed:   &lt;xsl:value-of select="t:TestRun/t:ResultSummary/t:Counters/@passed"/&gt;&lt;/li&gt;\n            &lt;li&gt;Tests Failed:   &lt;xsl:value-of select="t:TestRun/t:ResultSummary/t:Counters/@failed"/&gt;&lt;/li&gt;\n\n        &lt;/ul&gt;\n    &lt;table border="1" width="80%" &gt;\n        &lt;tr  class="resultsHdrRow"&gt;\n          &lt;th align="left"&gt;Test&lt;/th&gt;\n          &lt;th align="left"&gt;Outcome&lt;/th&gt;\n        &lt;/tr&gt;\n        &lt;xsl:for-each select="/t:TestRun/t:Results/t:UnitTestResult" &gt;\n        &lt;tr valign="top" class="resultsRow"&gt;\n            &lt;td width=\'30%\'&gt;&lt;xsl:value-of select="@testName"/&gt;&lt;/td&gt;\n            &lt;td width=\'70%\'&gt;\n              &lt;Div&gt;Message: &lt;xsl:value-of select="t:Output/t:ErrorInfo/t:Message"/&gt;&lt;/Div&gt;\n              &lt;br/&gt;\n              &lt;Div&gt;Stack: &lt;xsl:value-of select="t:Output/t:ErrorInfo/t:StackTrace"/&gt;&lt;/Div&gt;\n               &lt;br/&gt;\n              &lt;Div&gt;Console: &lt;xsl:value-of select="t:Output/t:StdOut"/&gt;&lt;/Div&gt;\n            &lt;/td&gt;\n        &lt;/tr&gt;\n        &lt;/xsl:for-each&gt;\n    &lt;/table&gt;\n  &lt;/body&gt;\n  &lt;/html&gt;\n&lt;/xsl:template&gt;\n\n&lt;/xsl:stylesheet&gt;\n</code></pre>\n'}, {'answer_id': 6011914, 'author': 'rido', 'author_id': 2158571, 'author_profile': 'https://Stackoverflow.com/users/2158571', 'pm_score': 2, 'selected': False, 'text': '<p>you can also try <a href="http://trx2html.codeplex.com" rel="nofollow">trx2html</a> </p>\n'}, {'answer_id': 10871709, 'author': 'Nikita R.', 'author_id': 182371, 'author_profile': 'https://Stackoverflow.com/users/182371', 'pm_score': 2, 'selected': False, 'text': '<p>If you need to validate the schema before parsing/transforming it, you can find the XSD file in the Visual Studio install dir (via <a href="http://blogs.msdn.com/b/dhopton/archive/2008/06/12/helpful-internals-of-trx-and-vsmdi-files.aspx" rel="nofollow">http://blogs.msdn.com/b/dhopton/archive/2008/06/12/helpful-internals-of-trx-and-vsmdi-files.aspx</a>):</p>\n\n<blockquote>\n  <p>Note, that the XSD schemas are available with all visual studio\n  installs in the:</p>\n  \n  <p><strong>%VSINSTALLDIR%\\xml\\Schemas\\vstst.xsd</strong> </p>\n  \n  <p>file directory, along with many\n  other schemas.</p>\n</blockquote>\n'}, {'answer_id': 28299550, 'author': 'Avinash Agrawal', 'author_id': 1735264, 'author_profile': 'https://Stackoverflow.com/users/1735264', 'pm_score': 0, 'selected': False, 'text': '<p>Recently I wrote one trx to html convertor which is python based, have a look\n<a href="https://github.com/avinash8526/Murgi" rel="nofollow">https://github.com/avinash8526/Murgi</a></p>\n'}]
['https://Stackoverflow.com/questions/23446', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/443/']