TRX files?

Aug 22, 2011 at 11:57 AM


Are there any plans of making the tool generate TRX files from the test results?

Martin M
Software Architect

Aug 22, 2011 at 7:45 PM

There's no explicit or immediate plans to, however I don't think it has to stay this way.

The following link may help you with your needs ( Others have accomplished this by cobbling some things together, although not ideal.

I don't think it would be too hard to add support, however I have not found very much information/documentation regarding the output format. So if you don't feel like forking and adding the support directly into the project, but could do some research and help track down how to implement it. I could take a stab.


Aug 23, 2011 at 2:28 PM

Well, a couple of XML schemas would be a great start for conjuring up a transformation. The shcema file for MSTest can be found in C:\Program Files (x86)\Microsoft Visual Studio 10.0\Xml\Schemas\vstst.xsd. I haven't had that much time looking at the source code of StatLight. Is there a good XML schema for the produced XML?


Aug 25, 2011 at 1:20 AM

I pushed a new branch called "trx" up to github

I laid the original groundwork to get this accomplished. The following file is what you will need to change to make this thing work. I stubbed it out, but it is not working at it's current state.

I'm on vacation and can try to put more time on it when I get back. However no guarantees. Please take a stab at it and let me know if you have any questions.

Be sure to use the .bat files to accomplish builds and run tests.

Hope this helps.


Sep 7, 2011 at 5:12 AM

Hi guys, sorry to butt in, can I add my vote for this one? If StatLight can spit out a TRX file for us then we can easily automate the publishing of those results using MSTest within our TFS 2010 build process, which would be fantastic.

Happy to wait for this in an upcoming release, would appreciate a ping when it is.



Sep 18, 2011 at 4:41 AM
Edited Sep 21, 2011 at 9:12 PM

Hey Guys,

I have some initial work for the TRX support out on the latest and greatest. If you go the statlight home page there's a link to latest build up on teamcity. Could you please download, try and give any feedback you have?

The following file is where I'm generating the output from

If you have any suggestions, I'm all ears.

As I don't use MSTest (or need the TRX for anything) I won't be dog fooding this. So please report any issues and I'll try to get them fixed.


Sep 21, 2011 at 4:13 PM

Any status guys?

Sep 21, 2011 at 9:02 PM

404 on that last link.

Sep 21, 2011 at 9:13 PM
Edited Sep 21, 2011 at 9:13 PM

I updated the link - (removed the trx branch as I merged it into master).

You can download the latest version from teamcity (go to home page to find the link) you should be able to run statlight and specify the report output type of TRX. Let me know if that works for you.

Dec 9, 2011 at 9:01 AM

I use it on the PC: WinServer2008SP2 x64, Silverlight 4:

StatLight.exe -x=mytest.xap --ReportOutputFileType=TRX -r=.\test.trx (-r=test.trx - doesn't work)

I got test.trx, but the report did not contain the "owner" attribute for the tests.
I added it only for the TRX report.

Next problem was
WebBrowserType = defaultValue(selfHosted) doesn't work on the x64 platform. Did you check it?
I built it for the x86 platform and it works. For the another WebBrowserType (chrome, firefox) it works for the x64 platform too. 

I will send my changes to you.

Dec 9, 2011 at 2:44 PM

Hello Vladimir,

Thanks for your patch you sent me. I've included it

The selfHosted is a known issue in general because if you build StatLight to run on x64 it will therefore use an x64 browser control. Silverlight doesn't run in a x64 bit browser (yet). The solution as you found out is to change the build platform target to x86. Also if you try to use the firefox/chrome browser types, these are separate processes and I believe they startup in x86 mode by default anyway. Which is why it probably worked for you. Hope this helps.

Again, thanks for the patch. Let me know if you notice any other issues with the TRX format.

Jan 28, 2014 at 5:07 PM

I generate unit test reports based on TRX format.
Is it possible to fill up codeBase same as MS does (full path to the test assembly)? At the moment it is empty.
new XElement(ns + "TestMethod"
                              , new XAttribute("codeBase", string.Empty)
I use codebase during xslt transformation later

Thank you
Jan 30, 2014 at 12:21 PM
pgrishanov wrote:

I generate unit test reports based on TRX format.
I implement filling codeBase with the xap name in my local version of the StatLight.
Jan 30, 2014 at 7:18 PM
Great initiative on and thanks for submitting a Pull request.