Searching and Grouping in VS 2012 Test Explorer

Posted Sun, Sep 16 2012 12:59 by Deborah Kurata

Visual Studio 2012 Test Explorer has extensive searching and limited grouping capabilities. (Visual Studio 2010's Test View window had more grouping options by way of its many sorting parameters.)

Searching

Entering text into the Test Explorer Search box filters the list of tests to those containing the entered text. In the example below, entering "customer" in the search box filters the list to all test names containing "customer".

image

By default, the search matches within the test name, but there are other choices. To view the other options, click the down arrow to the right of the Search box in the toolbar as shown below. Even though it looks a little like one large option name, these are actually three options:

  • Test File Path
  • Fully Qualified Name
  • Test Result

image

Select one of these options, then type the search parameter within the provided quotation marks. Press the Enter key to execute the search.

image

Test File Path searches the paths to the test code files. In this example, the tests are in two components in two different directories:

  • C:\Users\Deborah\Speaking\Other\AcmeCustomerManagement_BestKeptSecrets_2012\ACM.LibraryCSharpTest
  • C:\Users\Deborah\Speaking\Other\AcmeCustomerManagement_BestKeptSecrets_2012\ACM.BLCSharpTest

The above example finds all of the tests in the LibraryCSharpTest component.

Fully Qualified Name searches the path and file name.

Test Result has several valid search parameters: "Not Run", "Skipped", "Passed" or "Failed". These options filter the list to defined  test outcome.

Grouping

By default, the Test Explorer groups the tests by test outcome as shown in the prior screen shots. The only other group-by option is by duration. This groups by the time it took to execute the test.

image

Use these techniques to filter and group the tests in the Test Explorer window.

Enjoy!

EDITED 9/28/12 to correct typographical errors.

Filed under: , , , ,

Comments

# 101 Ways to Run Tests with Visual Studio 2012

Sunday, September 16, 2012 3:59 PM by Deborah's Developer MindScape

OK 101 is an exaggeration, but there are many ways to run your tests in Visual Studio 2012. From the

# Test Explorer in Visual Studio 2012

Sunday, September 16, 2012 7:30 PM by Deborah's Developer MindScape

One of the new things about testing in Visual Studio 2012 is that it is now available in *all* editions

# Running Your Unit Tests Continuously

Wednesday, September 26, 2012 6:56 PM by Deborah's Developer MindScape

One of the new unit testing features in VS 2012 (Premium or Ultimate) is the continuous test runner.

# re: Searching and Grouping in VS 2012 Test Explorer

Friday, September 28, 2012 9:43 AM by Richard

Small typo: it's "Test file path", not "Text file path".

# re: Searching and Grouping in VS 2012 Test Explorer

Friday, September 28, 2012 12:12 PM by Deborah Kurata

Thanks Richard. I made the correction in the above text.

Leave a Comment

(required) 
(required) 
(optional)
(required) 
If you can't read this number refresh your screen
Enter the numbers above: