Understanding Web Tests

[This documentation is for preview only, and is subject to change in later releases. Blank topics are included as placeholders.]

A Web test, also called a declarative Web test, consists of a series of HTTP requests. Web tests work at the protocol layer by issuing HTTP requests. Web tests do not run JavaScript. However, you can simulate JavaScript actions at runtime by using Web test plug-ins, Web test request plug-ins, extraction rules, or coded Web tests.

Web tests are used to test the functionality of Web applications and to test Web applications under load. Web tests are used both in performance tests and stress tests.

You can create Web tests by recording your activities in a browser session. You can also build Web tests manually by using the Web Test Editor.

To test Web applications, you create Web tests by recording a test that navigates through a Web application.

Web Test Benefits

You can create Web tests for use in an extensive set of testing purposes:

  • Create functional tests that exercise your Web applications.

  • Create data-driven tests.

  • Create and run tests that can test the performance of your applications.

  • Use .NET languages for test authoring, debugging, and test extensibility.

Web tests automatically handle these aspects of HTTP:

  • Hidden field correlation including VIEWSTATE

  • Redirects

  • Dependent requests

  • Authentication

  • Security through HTTPS/SSL

By using the Web Test Viewer, you can view and debug your Web tests for verification. For more information, see How to: Run a Web Test.

Coded Web Tests

A Web test starts as a list of URLs, representing Web requests, in the Web Test Editor. If necessary, these requests can be converted to Visual C# or Visual Basic code, called a coded Web test. After a Web test has been converted to its coded format, looping and branching constructs can be added. For more information about how to create a coded Web test, see How to: Create a Coded Web Test.

Considerations for Load Testing

Web tests, although useful by themselves, are also used in load tests. Load tests allow you to aggregate several Web tests that simulate a real user load on your Web site. Before you can exercise the load test functionality, you must first create a Web test or several Web tests.

You can set properties on load tests that broadly apply to the individual Web tests. You can combine Web tests with unit tests in a load test, when appropriate in your test plans.

For more information about load tests, see Working with Load Tests.

Security

Web tests and Web test results contain potentially sensitive information that could be used to build an attack against a computer or network. Web tests and Web test results contain URLs and connection strings. You should be aware of this when you share tests or test results with others.

See Also

Tasks

How to: Record a Web Test

How to: Add an Extraction Rule to a Web Test

How to: Create a Web Test Plug-In

How to: Create a Coded Web Test

How to: Run a Web Test

Concepts

About Validation Rules

About Extraction Rules

About Data Binding in Web Tests

About JavaScript and ActiveX Controls in Web Tests

Other Resources

How to: Create a Web Test Request Plug-In

Working with Load Tests