Have just started using Visual Studio Professional's built-in unit testing features, which as I understand, uses MS Test to run the tests.
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?
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 :)
A trx file is a software developers test results file . . . The file is in XML format, so if you do not have Visual Studio, you can choose to open that in Notepad, it will look something like a tagged html file . . .
From Windows file explorer, drag the TRX file onto the title bar of Visual Studio (the very top of the window). You should then see the file in the "Test results" pane, double click on the test there.
To generate a TRX file with SpecFlow+ Runner, you will need to start your tests from the command line using vstest. console.exe with the /logger:trx option to generate a TRX file. You have to execute it in the output folder of your test project ( bin\debug\ ).
Run tests in Test Explorer If Test Explorer is not visible, choose Test on the Visual Studio menu, choose Windows, and then choose Test Explorer (or press Ctrl + E, T). As you run, write, and rerun your tests, the Test Explorer displays the results in a default grouping of Project, Namespace, and Class.
Since this file is XML you could and should use xsl to transform it to another format. The IAmUnkown - blog has an entry about decoding/transforming the trx file into html.
You can also use .NetSpecExporter from Bekk to create nice reports. Their product also uses XSL, so you could probably steal it from the downloaded file and apply it with whatever xsl-application you want.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With