About Extraction Rules

[This documentation is for preview only, and is subject to change in later releases. Blank topics are included as placeholders.]

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.

Validation rules are similar to extraction rules, but instead of extracting data, they validate the existence of data. For more information, see About Validation Rules.

Predefined Extraction Rules

Visual Studio Team System Test includes the following predefined extraction rules:

Extraction Rule Type


Extract Attribute Value

Extract the value of an attribute from a specified HTML tag.

Extract Form Field

Extract the value of a specified form field in the response.

Extract HTTP Header

Extract the value of an HTTP header.

Extract Regular Expression

Extract text from the response matching a regular expression.

Extract Text

Extract text from the response.

Extract Hidden Fields

Extract all hidden fields from the response.

Custom Extraction Rules

Team System Test provides predefined extraction rules in the form of classes in the Microsoft.VisualStudio.TestTools.WebTesting.Rules namespace. However, you can create your own custom extraction rules by deriving from the ExtractionRule class. For more information, see How to: Create a Custom Extraction Rule.

See Also


How to: Add an Extraction Rule to a Web Test

How to: Create a Custom Extraction Rule

Walkthrough: Adding Validation and Extraction Rules to a Web Test





About Validation Rules