How to: Filter Tests

You can filter the display of tests using controls on the Test List Editor toolbar and the Test View window toolbar.

Why would you want to filter tests? You might be working in a build lab and need to determine whether a specific bug is still present, so you filter out all tests that do not apply. This might mean filtering to include only Web tests, or only load tests, and so on. Or you might need to test a specific method or class, so you filter to include only the unit tests that apply.

To filter the display of tests

  1. In the toolbar of the Test List Editor or the Test View window, click the down arrow in the Filter Column list box, and then click a property by which to filter.

    Example properties to choose from are Namespace, Class Name, Owner, Project, Test Enabled, and Test List Name.

    Tip

    Selecting a property to filter by does not add that property as a column. To add a column, right-click the column headings and click Add/Remove Columns. Then, in the Add/Remove Columns dialog box, select columns to add and define the order in which they appear, using the Move Up and Move Down buttons. When you are finished, click OK. For more information, see How to: Customize Test Views.

  2. In the Filter Text list box, type a string value by which to filter.

    For example, if you have selected Class Name as the Filter Column, you could type the name of a class, "BankAccountTest," for the filter text.

    Note

    Filtering is not performed in a case-sensitive manner. "BankAccountTest" and "bankaccounttest" produce the same results.

  3. Click the Apply Filter button.

    The filter is applied. Only tests that have the chosen value for the chosen criterion, as displayed in the Filter Column list box, are displayed.

To stop filtering tests

  • To show all tests, you can clear the filter that is currently in use. To do this, in the Filter Text list box, click <Clear Filter>.

    If you are using the Test View window, it displays all the currently loaded tests.

    If you are using the Test List Editor, it displays all the tests in the currently selected test list. If no test list is selected, the contents of the current selection, such as All Loaded Tests or Tests Not in a List, are displayed.

See Also

Tasks

How to: Customize Test Views

Other Resources

Managing Tests