How to: Create a Coded Web Performance Test
A coded Web performance test is typically created by converting an existing, recorded Web performance test into a coded Web performance test. A recorded Web performance test begins as a tree of requests that are visible in the Web Performance Test Editor. A coded Web performance test is a .NET class that generates a sequence of WebTestRequests. It can be programmed by using either C# or Visual Basic. A coded Web performance test can be created manually, but it is suggested practice to convert a recorded Web performance test to a coded Web performance test.
After a Web performance test has been converted from recorded to coded, you can edit that code like any other source code. Additionally, you can add looping and branching constructs, dynamically change the number of requests in the test, and dynamically generate the set of URLs that the test hits.
For more information about the API for the Web testing tools, see How to: Use the Web Performance Test API.
Coded Web performance tests are launched from either the Test menu or Test Explorer. You can use coded Web performance tests in load tests. For more information about load tests, see Creating and Editing Load Tests.
If you want to use data binding or any one of the plug-ins in your coded Web performance tests, it is a good practice to add them before generating the coded test. This is because it is easier to have Visual Studio Ultimate generate the data-binding code than to write it yourself.
Visual Studio Ultimate
To convert a recorded Web performance test
Open a solution that contains a recorded Web performance test.
For more information, see How to: Create a New Web Performance Test Using the Web Performance Test Recorder.
Open the Web performance test file.
You can use the Web performance test that is created in the following two walkthroughs to create a coded Web test: Walkthrough: Creating a Simple Web Application and Walkthrough: Recording and Running a Web Performance Test.
Choose the Generate Code button on the toolbar in the Web Performance Test Editor.
You are prompted for a name for the coded Web performance test.
Type an appropriate name in the dialog box for the coded Web performance test class that is generated, and then choose OK.
Choose Build, and then choose Build Solution from the menu.
Your code compiles.
For information about running your coded Web performance tests, see How to: Run a Coded Web Performance Test.