How to: Create a Test-level Validation Rule for a Web Performance Test
This topic applies to:
Visual Studio Ultimate
Visual Studio Premium
Visual Studio Professional
Visual Studio Express
You can add validation rules to Web performance tests at the test level. A test-level rule fires on every request in the test. In other words, adding a test-level validation rule is a shortcut for adding the same rule to every request. By default, such rules apply only to top-level requests. In the code of a coded Web performance test, you can apply test-level validation rules to dependent requests.
One purpose for using a test-level rule is to detect incorrect flow in a test. Errors in the server application could cause such incorrect flow by causing the playback of the Web performance test to vary from the recorded sequence. You can also create test-level rules to check content length and response time, to validate content that must appear on every page, or to validate that all pages conform to a specific criterion such as accessibility.
There is no way to override or turn off a test-level validation rule for a given request. If a request contains the same validation rule as a test-level rule, both rules will fire.
To add a test-level validation rule
Open a Test Project that contains a Web performance test.
Open a Web performance test in the Web Performance Test Editor.
If at least one test-level validation rule exists, the Validation Rules folder appears after the final request in the test. You can add, delete, and modify validation rules at this level in the same way that you can work with validation rules for an individual request.
Right-click the Validation Rules folder and select Add Validation Rule.
- or -
Right-click the Web performance test node and then select Add Validation Rule.
The Add Validation Rule dialog box appears. Under Select a rule, you see the available predefined and custom validation rules. Select a validation rule.
(Optional) Under Properties for selected rule, edit or add options and parameters.
Run your Web performance test.