Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where is the Visual Studio 'Test Explorer' Output located? Is it a saved file?

I'm using SpecFlow for unit testing in Visual Studio 2013, and when I run tests from the Test Explorer window, there is a link to an Output which shows anything written to the console during the test.

Output link

When right-clicking the tab, I don't have the option to Open Containing Folder like I do with other project files.

Path-related options not available

Is this a file that's being saved somewhere? Can I access it somewhere, or should I manually write the code to save it to a known location?

like image 682
austincrft Avatar asked Apr 27 '15 14:04

austincrft


People also ask

How do I save output in Visual Studio?

Press Ctrl+S. Visual Studio prompts you for a location to save the build output.

What is test Explorer in Visual Studio?

Use Test Explorer to run unit tests from Visual Studio or third-party unit test projects. You can also use Test Explorer to group tests into categories, filter the test list, and create, save, and run playlists of tests.

Where do Visual Studio builds go?

By default, Visual Studio builds each project in a solution in its own folder inside the solution. You can change the build output paths of your projects to force all outputs to be placed in the same folder.

How do I create a test report in Visual Studio?

To generate unit tests, your types must be public. Open your solution in Visual Studio and then open the class file that has methods you want to test. Right-click on a method and choose Run IntelliTest to generate unit tests for the code in your method. IntelliTest runs your code many times with different inputs.


1 Answers

After digging around a bit I couldn't find a way to actually view the results from the test explorer window run. So the best I can do is give you an alternative.

What you will want to do is run your test using a program called vstest.console.exe, this works almost exactly the same way as running from VS. You can find it under

C:\Program Files(x86)\Microsoft Visual Studio 12.0\Common7\IDE\CommonExtensions\Microsft\TestWindow\vstest.console.exe

run this from your cmd/terminal and set it up as you would like. You can enable logging, files are saved under the the TestResults folder in the same folder listed above, and you should be able to see your results. An example test run would look like:

vstest.console.exe D:\(Path To my Test)\(My Tests dll file).dll  /Settings:D:(Path tO my Tests)\(My Test settings file).testsettings /logger:trx
like image 132
Mo H. Avatar answered Oct 10 '22 15:10

Mo H.