While generating the code for the recorded web test, Visual Studio creates the code for the rules that we added. However, if more custom rules are to be added to the web test, use the
Microsoft.VisualStudio.TestTools.WebTesting namespace and create a new rule class, which is derived from the base class. This new class can be a part of the managed class library (which can be a plugin). This can be an extraction rule or a validation rule.
Extraction rules are used for extracting data from the responses received for web requests. Data can be extracted from text fields, headers, form fields, attributes, or from hidden fields. The new custom extraction rule is a new class file derived from the base class