Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 663
munchschair Avatar asked Jul 09 '19 18:07

munchschair


1 Answers

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
like image 84
Nouman Avatar answered Sep 28 '22 11:09

Nouman