Custom rules

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

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 ExtractionRule

Get Software Testing using Visual Studio 2012 now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.