Rediger

Test different configurations

Azure DevOps Services | Azure DevOps Server | Azure DevOps Server 2022

Users install or run your app on a wide variety of configurations, such as different operating systems, web browsers, and other variations. Run at least some of your tests in stages that have those different configurations.

Use test plans to decide which tests to run on which configurations. Make sure that when you run your tests, you set up your stages for the configurations that you need.

The following schematic matrix shows example combinations that you might want to test:

Diagram that shows a test matrix of browser and operating system configurations.

Prerequisites

Category Requirement
Project access Project member.
Access levels To add test configurations: Project-level Manage test configurations permission set to Allow. By default, members of the Contributors and Project Administrator groups have this permission.

For more information, refer to Manual test access and permissions.

Prerequisites for TCM command-line tool

Category Requirements
Tools Visual Studio 2017 (Professional or Enterprise) or earlier. The TCM executable (tcm.exe) is in the following directories:
- %programfiles(x86)%\Microsoft Visual Studio\2017\Professional\Common7\IDE
- %programfiles(x86)%\Microsoft Visual Studio\2017\Enterprise\Common7\IDE
- %programfiles(x86)%\Microsoft Visual Studio 14.0\Common7\IDE
Access levels At least Basic access and membership in the project you want to access. To clone or import test plans and test suites, you need Basic + Test Plans access. For more information, see Manual test access and permissions.

To run a TCM command, specify the /collection and /teamproject parameters, and /login as needed.

Parameter Description
/collection:CollectionURL Required. Specifies the URI of the team project collection. The format for the URI is as follows:
- For Azure DevOps Services: https://dev.azure.com/OrganizationName or https://OrganizationName.visualstudio.com
- For Azure DevOps Server: http://ServerName:Port/VirtualDirectoryName/CollectionName. If no virtual directory is used, the format is: http://ServerName:Port/CollectionName.
/teamproject:project Required. The name of the project that contains the test objects you want to clone or import automated tests into.
/login:username,[password] Optional. Specifies the name and password of a valid Azure DevOps user who has permissions to run the command. Use this option if your Windows credentials don't have the appropriate permissions, you're using basic authentication, or you're not connected to a domain.

View configurations and variables

View the configurations that are already available to run your tests.

View a list of test configurations and configuration variables from the Configurations page.

  1. In your project, select Test Plans > Configurations from the left navigation area.

    All test configurations and variables currently available for your test plans appear.

    Screenshot of the Configurations page showing test configurations and variables.

  2. Select a configuration or variable to view more information in the pane on the right.

Create configurations and variables

A test configuration is a combination of configuration variable values. Your configuration variables could be, for example, operating system, browser, CPU type, database. A configuration might be "Windows 8 + 32-bit CPU" or "Windows 10 + 64-bit CPU."

Create the configuration variables first, then combine multiple variable values to create a configuration.

  1. Open the Configurations page in the Test Plans web portal, select the + icon, and select New configuration variable.

    Screenshot of the New configuration variable option in the New menu.

  2. Enter a name for the variable, such as Browser, and a description. Select Add new value, and then add a value. Add as many values as you need to the configuration variable, and then save it.

    Screenshot of adding values to a new configuration variable.

  3. Repeat the steps to create any other configuration variables you need. For example, create a configuration variable named Operating system with the names of each operating system on which you want to test.

    Screenshot of setting values for an Operating Systems configuration variable.

  4. Select the + icon and select New test configuration.

    Screenshot of the New test configuration option in the New menu.

  5. Enter a name for the test configuration and add the configuration variables you created. Choose a value for each variable for this configuration.

    Screenshot of adding variables to the new test configuration.

    Make sure Assign to new test plans is selected to make this configuration the default for all new test plans you create.

  6. Save your new test configuration.

Assign configurations to test plans and suites

You can assign configurations to a test suite or an individual test case. Configurations assigned to a test suite apply to all tests or suites within it.

  1. To assign a configuration to a test suite, in the Test plans page, select a plan. In the Test Suites area, select a test suite and select More options or right-click to open the context menu and then select Assign configuration.

    Screenshot of the Assign configuration menu option for a test suite.

    If you add multiple configurations to a test suite, the test cases are repeated with each of the configurations you assigned.

    Screenshot of multiple configurations assigned to a test suite.

  2. If necessary, override the default configuration assigned to a test case and assign the configuration you need. Select one or more test cases, open the context menu, and select Assign configuration.

    Screenshot of assigning a configuration to test cases.

  3. Search for and select the configurations to assign to the test cases.

    Screenshot of selecting configurations for a test case.

Caution

  • Configuration inheritance: Changing configurations at a child suite breaks inheritance from its parent suites. The change still propagates down to lower child suites, unless a child suite already overrides it.
  • Hidden test points: Unassigning a configuration hides its related test points. To restore them, reassign the configuration.

Run tests with each configuration

Set up a testing platform for a particular configuration, such as testing the app using Google Chrome on Windows 10.

  1. Select and run a test that has this configuration assigned.

    Screenshot of a test with a specific configuration and the Run for web application option selected.

    As you run the test, a reminder of the configuration appears in the status bar.

    Screenshot of the configuration for this test in the status bar.

Track test results for each configuration

  1. Open the Charts page for your test suite, select New, and select New test result chart.

    Screenshot of the New test result chart menu option.

  2. Choose a chart type, like a pie chart or bar chart, and then select Group by > Configuration and choose OK.

    Screenshot of choosing a configuration option for group by in the configure chart dialog box.

    A chart is created that helps you track your tests based on configurations. You can pin this chart to your dashboard.

    Screenshot of a bar chart showing test results for Not run, Passed, and Failed by configuration.

If a test case appears in several test suites, you can set different configurations for each suite. The same test case can have different configuration settings in different test suites and test plans.