11

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.

munchschair
  • 1,593
  • 3
  • 19
  • 43

2 Answers2

8

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
Nouman
  • 591
  • 6
  • 14
1

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

Dave Glassborow
  • 3,253
  • 1
  • 30
  • 25