Test tools for .NET and cross-platform apps


There are a few new goodies added to your everyday test tools that I hope will improve your test inner loop! To familiarize yourself with these new features you can see them in action in the Visual Studio Tips and Tricks video on Testing or keep reading!

Show in Test Explorer

Easily jump from the editor to the test in the Test Explorer with the new Show in Test Explorer command (Ctrl+E,S). Show in Test Explorer is also available from the editor right-click menu, CodeLens test glyph, and the right-click in the Solution Explorer.

Image of the show in test explorer command in Visual Studio
Show in Test Explorer command in right-click menu

Play a sound when a test run completes!

The Test Explorer can now play a sound when a test run completes. You can select two sounds, one that indicates the test run succeeded with all passing tests and a second sound to indicate the test run completed with at least one failing test. These sounds are completely customizable using the Windows sound dialog!

Image of test audio cues in visual studio test explorer
Test Audio Cues in Test Explorer settings

Console.WriteLine in Test Explorer

Console.Writeline will now appear in the test detail pane. For xUnit, output that uses the ITestOutputHelper will appear. Standard output as well as standard error will be shown in this pane, so your test output is available where you need it.

Image of console writeline output appearing in test explorer in visual studio
Console.Writeline output appears in Test Explorer details

Remote Testing

Run and debug tests on Linux containers, WSL, or over SSH connections!

Visual Studio can make your cross-platform development easier than ever with remote testing! You can now run Linux tests from Visual Studio by connecting the Test Explorer to remote environments. These can be Linux containers, WSL, and even SSH connections! Check out the setup documentation to get started at https://aka.ms/remotetesting.

Normally I’d have to push to a CI run before getting feedback from Linux test or other operating systems, but now I can get it all in my inner dev loop, including debugging a test in a Linux container.

Image of remote testing in visual studio debugging a test in a Linux container
Debug a test in a Linux container with Remote Testing

Test web apps with Playwright

Playwright is the latest in cross-platform, asynchronous web UI testing. It’s built with modern browsers and services in mind meaning each step automatically uses awaits. This reduces the flakiness that typically plagues web UI tests. Not only is Playwright cross-platform, but it is also cross-language supporting TypeScript, JavaScript, Python, Java, and .NET. It also comes with a recorder that generates tests based on your actions. Read more https://playwright.dev.

Image of playwright recorder generating .NET test code
Playwright recorder generating .NET tests

Where can I learn more?

If you are interested in more on performance, how hot reload can apply to the Test Explorer, or more on running tests over SSH connections check out the longer demo from .NET Conf.

You can find more test tools documentation at http://aka.ms/visualstudiotest.

To get started with Remote Testing follow the instructions at https://aka.ms/remotetesting.

As always, we are incredibly thankful to the community who suggested many of these features, commented design suggestions, and upvoted them to the top of our backlog! This guidance is invaluable to creating tools that the community loves. Share what you’d like to see next in your test experience in the comments!

Thanking you all and wishing you well,


Leave a comment

  • Shimmy Weitzhandler

    To me, as long as horizontal scroll (Shift+scroll) isn’t supported on VS, and especially in test explorer, it’s still considered broken.

  • Swati Sharma

    My focus is on the programming side rather than real testing, so I am not a testing expert. However, while dealing with.Net, I favour xUnit.net over NUnit for unit testing.

  • Jonathan Lane

    Are there any plans to make an extension similar to Test Explorer for Visual Studio Code? The current extensions for C# tests pale in comparison to the Visual Studio offering.

  • James Lonero

    One function that would be useful is to add a button to the test explorer that would reset all of the tests to “Not run” Therefore, I could start with a new slate of all of the tests and when running only the tests I need, I will easily be able to know which passed and which didn’t without looking through all that had run previously. I was hoping for something like this function in VS2019, but it has not come. Hopefully in VS2022.

  • Christian Andritzky

    The “Show in Test Explorer” command is definitely a welcome (and long needed) addition.

    But it’s still not enough to handle huge solutions with thousands or tens of thousands of tests.
    This is the main reason why we still cannot phase out third party tools (namely: ReSharper) and solely work with VS built in features.
    From my point of view there are two feature missing:
    1. Working with unit test “sessions” that contain only a (small) subset of all available tests. Or maybe extend the playlist feature.
    2. Have an (interactive) icon on the gutter for running/debugging tests and showing the last run state in addition to the code lens glyph. Please note that people turn off code lens in large solutions for performance reasons.

    And of course – as always – improve performance and responsiveness for large solutions 😉