How to: Select the active run setting for a load test
Applies to: Visual Studio Visual Studio for Mac
Note
This article applies to Visual Studio 2017. If you're looking for the latest Visual Studio documentation, see Visual Studio documentation. We recommend upgrading to the latest version of Visual Studio. Download it here
After you create your load test with the New Load Test Wizard, you can use the Load Test Editor to change the scenarios properties to meet your testing needs and goals.
Note
Web performance and load test functionality is deprecated. Visual Studio 2019 is the last version where web performance and load testing will be fully available. For more information, see the Cloud-based load testing service end of life blog post. To reduce the impact on users some minimum support is still available in Visual Studio 2022 Preview 3 or later. Users should also note web performance and load test functionality only supports Internet Explorer which is not available on Windows 11 and some versions of Windows 10. Read more on Internet Explorer Lifecycle policy.
A load test can contain one or more run settings which are a set of properties that influence the way a load test runs. Run settings are organized by categories in the Properties window. When a load test is run, it uses the run setting that is currently set as active.
Note
For a complete list of the run settings properties and their descriptions, see Load test run settings properties.
If your load test contains only one run setting node under the Run Settings folder, that node is always the active node. If your load test contains multiple run settings nodes, you can select the one to use when you run a load test. See How to: Add Additional Run Settings to a Load Test.
In the Load Test Editor, the active run setting is identified by the "[Active]" suffix.
Select the active run setting
Open a load test.
Expand the Run Settings folder.
Right-click the run settings node that you want to be the active node, and then choose Set As Active.
In the Load Test Editor, the affected run setting node is updated with the "[Active]" suffix.
The run setting selected becomes active, and remains active until you select a different run setting to be active.
Note
You can override the active run setting by setting an environment variable named Test.UseRunSetting=<run setting name>
. This is useful when you run a load test from the command line or from a batch file. This lets you choose different run settings without opening your load test.
Specify the run setting to use from the command line
You can override the default run settings in your load test by setting an environment variable from the command line:
Set Test.UseRunSetting=PreProdEnvironment
And to run the test:
mstest /testcontainer:loadtest1.loadtest