How to: Use the Web Test API
You can write code for your Web tests. The Web test API is used to create coded Web tests, Web test plug-ins, request plug-ins, requests, extraction rules, and validation rules. The classes that make up these types are the core classes in this API. The other types in this API are used to support creating, , , , , and objects. You use the namespace to create customized Web tests.
Use the object browser to examine the Microsoft.VisualStudio.TestTools.WebTesting namespace. Both the C# and Visual Basic editors offer IntelliSense support for coding with the classes in the namespace.
You can also create plug-ins for load tests. For more information, see.
Using the Web test API
Open a Test Project that contains a Web test.
For more information, see.
Add a C# or a Visual Basic Class Library Project to your test solution.
Add a reference in the Test Project to the Class Library Project.
Add a reference to the Microsoft.VisualStudio.QualityTools.WebTestFramework dll in the Class Library project.
In the class file located in the Class Library project, add a using statement for the Microsoft.VisualStudio.TestTools.WebTesting namespace.
Implement any of the core classes in the namespace in the Class Library project. For an example implementation of WebTestPlugin, see. You can write the rest of the code that you need, and then build the project.
Run your Web test.