house9

random code and what not

MSTest output result to HTML

MSTest generates trx (xml) files which can be viewed in Visual Studio. But often you will be executing MSTest from the command line via your Continuous Integration (CI) server and you will want to view them in an html format outside Visual Studio.

trx2html to the rescue!

  • download the zip file here - http://trx2html.codeplex.com/
  • unzip and put the files somewhere
    • I choose C:\Program Files (x86)\trx2html
  • execute it from the command line 

# in YourTestProject\bin\Release
"C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\mstest.exe" /testcontainer:YourTestProject.dll /resultsfile:TestResult.trx

"C:\Program Files (x86)\trx2html\0.6\trx2html.exe" TestResult.trx
# outputs TestResult.trx.htm


Comments

House 9
Try running it from the directory that your trx file is in

> cd DIRECTORY_WIHT_TRX_FILE

> "D:\share\TRX2HTML_A\0.6\trx2html.exe" TRX_FILE_NAME
Atul Mhetre
Hi,

I am having problem in converting trx file into HTML file.

I navigate to trx2htm.exe in command prompt and used command as - D:\share\TRX2HTML_A\0.6>cd D:\share\TRX2HTML_A\0.6

D:\share\TRX2HTML_A\0.6>trx2html atul.mhetre_NTPC01395 2013-01-22 15_05_51.trx
trx2html.exe
Create HTML reports of VSTS TestRuns. (c)rido'08
version:0.6.0.2798

Usage: trx2html .trx

D:\share\TRX2HTML_A\0.6>

So I am getting output as -

trx2html.exe
Create HTML reports of VSTS TestRuns. (c)rido'08
version:0.6.0.2798

Usage: trx2html .trx

And no html file is generating. Please help.