I have the Enterprise edition of Visual Studio, but not everyone does.
How can I share the TRX so that other people can see the results? I've seen that there are several Trx to HTML convertors but they're all quite old and either don't work any more or don't show the details of the test.
Most of the results of a load test are stored in a database. The TRX file has only a very small portion of the results - you can easily see what it actually contains by opening the file in Notepad, it is just XML.
Visual Studio trial versions have some support for load tests. (They only support a small number of virtual users and do not support plugins.) They might allow viewing and analysis of the results of runs done on other computers. This limited support of load tests might also be available on licenced Non-Enterprise versions.
The results of individual load test runs, or groups of runs, can be copioed from one computer to another by using the Export and Import commands in the "Open and manage load test results" window. These create and read LTRAR files. See here for more details.
The TRX file contains a connection string to the SQL database and so the file cannot normally be copied and then work properly on another computer. The encoded connection string is located within the resultsRepositoryConnectString=... attribute within the TRX file. Changing the value in a copied file to a value found in a working TRX file on the destination computer allows the copied file to work. See here for more details.
The only other options for viewing results on other computers would be by exporting the results in Excel by using the "Create Excel Report" command. (Access it via the icons on the "Summary - Graphs - Tables - Details - ..." line in the load test results viewer.)
For unit tests, but not load tests, I routinely export trx files from my unit tests, because they ARE shareable, can be placed as attachments into our launch control systems, and DO contain all of the data necessary for the downstream teams to verify the results, including test console output. I do this with a custom task added to the project that runs the vstest.console.exe, with the /logger:trx;logfilename="blah" command line switch. The full task line is:
<Exec Command=""$(DevEnvDir)commonExtensions\Microsoft\TestWindow\vsTest.console.exe" "$(MSBuildProjectDirectory)\$(OutputPath)$(AssemblyName).dll" /logger:trx;LogFileName="$(MSBuildProjectDirectory)\testResults.trx"" />
You can also add ContinueOnError="true" if you don't want a test failure to stop the build.
MSTest still seems to ship with visual studio, supposedly does support load tests, and historically has exported TRX files, but I haven't tried it. Running pre-2019 unit test projects, that still have tasks pointed to mstest, in vs2019 tend to fail with assembly version errors, so I don't know if it even still works at all.
Related
We have upgraded to TFS Update 2 release management recently. Enabled code coverage in Visual Studio Test as show below.
Build runs successfully and show test cases execution result.
But I dont see Code Coverage information. Do we need any other configuration?
UPDATE:
I tries detaching the collection, but no luck.
In your build definition you specify using .runsettings file for Code Coverage. So when Code Coverage is ran it loads the collectionscodecoverage.runsettings file and returns result depending on whats in it. Most likely .runsettings file is not correct.
You can collect Code Coverage without having a settings file. Just leave the "Run Settings File" option empty on build definition.
To validate that your .runsettings file is correct - run Code Coverage locally from Visual Studio having .runsettings file set as default test settings file. See details here.
Another possible problem addressed in this post.
I have a large number of test cases in Testlink and I need to export them into either OpenOffice Calc or Writer (and then possibly reimport them), including test steps.
Currently Testlink only supports XML for exports and imports of test cases. To import an XML file into OpenOffice and export it, specifically formatted XSLT files are needed. To create them appears to be rather time consuming if you are not an XML expert.
Did anybody do this already? Does anybody have examples or working XSLT files for Testlink test cases, for Calc or Writer?
My bad. It turns out that it is very easily possible to export test cases with test steps:
Choose Test Reports in the topmost menu of Testlink.
On the Reports and Metrics page, select OpenOffice Writer (or MS Word) as the Report Format.
On the left side, select Test Plan Report. On the right side, select the checkbox Test Scenario (you don't need Test Summary or any other options). Below, click on the test case folder that you wish to export.
You get the document for download. (Note: may require some formatting.)
Alternatively, it is possible to choose HTML in step 2 as the report format and save the frame.
While it is possible to select OpenOffice Calc/MS Excel, there doesn't seem to be a way to include test case steps.
Can you change the test report subjects?
Choose Test Reports in the topmost menu of Testlink.
On the Reports and Metrics page, select OpenOffice Writer (or MS Word) as the Report Format.
On the left side, select Test Plan Report. On the right side, select the checkbox Test Scenario (you don't need Test Summary or
any other options). Below, click on the test case folder that you wish to export.
You get the document for download.
Can i change the download file name?
When i choose the testcase folder, i can download the test report(MS word). but file name is "Test Project name.doc". so I want to change the file name from "Test project name" to "Test Plan name"
I have been using MTM for a time and, so far, so good. I am trying to get Code Coverage over the tests I am executing. I have set my controller with 2 machines: 1 webclient and 1 webserver. For the webserver rule, i have configured code coverage. Of couse the webserver machine is the one that has my application running on IIS.
When I fire my automated tests (that btw were not created using visual studio, it was created using Ranorex) I can see that its generated an .coverage file.
But when I open this file, it is empty and I get this message from Visual Studio:
Empty results generated: No binaries were instrumented. Make sure the tests ran, required binaries were loaded, had matching symbol files, and were not excluded through custom settings. For more information see http://go.microsoft.com/fwlink/?LinkID=253731
Of course I have read
http://go.microsoft.com/fwlink/?LinkID=253731
http://msdn.microsoft.com/en-us/library/vstudio/hh698492.aspx
http://msdn.microsoft.com/library/jj159523.aspx
But I have found nothing wrong in my scenario.
Does anyone have any idea what could be happening?
Go and check if you find one of the following files in your solution: Local.testsettings or TraceAndTestImpact.testsettings and double click them in VS. A new window will open, there you need to select Data and Diagnostics. There you'll see a point Code Coverage, double click it and then select all the assemblies that you want to be code coveraged.
If that does not work, check if your PDB files are present next to your DLL files.
Well. It turned out to be a problem with the permissions of the user I was using to run the test agent on the web server.
After changing the user to another one who has more permissions everything worked fine.
We have a set of user acceptance tests (written in MSTest) which run fine locally, they're referring to some test files which the acceptance tests load in and process.
However, when running on team build (TFS 2010) the path to the files we're using is obviously different and the file cannot be found. This is still the case with using relative paths as the depth at which the local tests happen is different to the depth at which they happen on the build server.
What's the best way to refer to a file in tests so that it works both locally and during team build test runs.
I've considered putting them in the team project but I don't even know what the path to that will be.
Any ideas much appreciated!
Try the [DeploymentItemAttribute][1]
Is there any tool exist that transfroms trx file into Excel format?
I am looking for something that will automate unit test result publishing at the time of test suite execution (without requiring microsoft team server)
You can use http://trx2html.codeplex.com/ which provides an easy way to convert an rtx file into an html document.
If you just need the information about the test name and whether passed or failed, you could copy the columns from Test Results UI (in Visual Studio) and paste on excel.
I created a tool for this propose, the trx file will be converted to Excel 2010 format with useful information.
Pls try: https://youtu.be/G7VASkhim7I
Instructions
Download the Trx2Excel application from here and run the application.
Select the option: Get data from one file or from a folder.
Select the result file (for single file option) or result folder (for multiple files option).
Select the location and the saved file (the output file).
Click the Convert button.