Using Validation and Extraction Rules
Validation rules help verify that a Web application is working correctly by validating the existence of text, tags, or attributes on the page returned by a Web request. Validation rules can also verify the time it takes a request to finish, and the existence of form fields and their values.
Extraction rules help verify that a Web application is working correctly by extracting data from the responses to Web requests. Extraction rules store results in the test context as name value pairs. Extraction rules can extract form fields, text, attributes, headers, regular expressions, and hidden fields.
The topics in this section describe how to create and use validation and extraction rules in Web tests.
In This Section
How to: Add a Validation Rule to a Web Test
Describes how to add and configure a validation rule.How to: Add an Extraction Rule to a Web Test
Describes how to add and configure an extraction rule.How to: Create a Custom Validation Rule
In addition to using the validation rules that are predefined in Microsoft Visual Studio Team System Test Edition, you can create your own validation rules by deriving them from the ValidationRule base class. This topic describes how to create a custom validation rule and then add it to a Web test request.How to: Create a Custom Extraction Rule
In addition to using the extraction rules that are predefined in Test Edition, you can create your own extraction rules by deriving them from the ExtractionRule base class. This topic describes how to create a custom extraction rule and then add it to a Web test request.How to: Create a Test-level Validation Rule
Describes how to add validation rules to a Web test at the test level.
Reference
Microsoft.VisualStudio.TestTools.WebTesting.Rules