munchschair
munchschair

Reputation: 1683

How do I save test results from Test Explorer in Visual Studio 2017?

I have an issue with Visual Studio 2017. I generally run a set of tests locally on my own computer using Test Explorer and using Microsoft's own Unit Testing tools in the Visual Studio library. This can take quite sometime. Problem is, if I close visual studio at any point, the results of these tests are lost forever: the pass, the fail, the output, everything.

I need a way to save the results of my tests in case this happens. I'd love it if VS didn't just wipe my test results like this.

I have to run many tests in different windows, using the command prompt to do this is incredibly laborious.

Upvotes: 14

Views: 15527

Answers (2)

Dave Glassborow
Dave Glassborow

Reputation: 3553

You can configure trace logging using a test settings file, documented here.

Upvotes: 1

Nouman
Nouman

Reputation: 619

You can use the command line tool VSTest.Console.exe command-line options and save the output to file using /Logger: option.

It can be found under

(Visual-Studio-Directory)\(Version-Year)\Common7\IDE\Extensions\TestPlatform

Sample:

vstest.console.exe "C:\TestProjectFolder\TestProject.dll" --logger:trx

Upvotes: 9

Related Questions