O'Reilly logo

Software Testing using Visual Studio 2012 by Satheesh Kumar. N, Subashni. S

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required