Share via


About JavaScript and ActiveX Controls in Web Performance Tests

In Visual Studio Ultimate, you record your Web performance tests in the Web Performance Test Recorder. You run your Web performance tests by using the Web Performance Test Engine. The Web performance test engine works at the HTTP layer. The Web performance test engine uses standard HTTP request/response messages to communicate directly with the target Web server. It does not execute JavaScript.

Note

The Web Performance Test Recorder records both AJAX requests and requests that were submitted from JavaScript. The Web performance test engine does not execute JavaScript.

This document will discuss how to handle JavaScript, ActiveX controls, pop-up windows, and AJAX in your Web performance tests.

JavaScript

Usually, you will not have to add any special handling to your Web performance test for JavaScript in your Web application. While you record your Web performance test, JavaScript will run as expected, according to your Internet Explorer settings. Any values produced by JavaScript for use as form parameters or query string parameters will be captured by the Web Performance Test Recorder. When you run your Web performance test with the Web performance test engine, the JavaScript will not run, but the parameter values set during recording will be used.

JavaScript and the Web Performance Test Results Viewer

You run your Web performance test by using the Web performance test engine, and view the results in the Web Performance Test Results Viewer. The Web Performance Test Results Viewer contains a tab that displays the HTTP response for each of the requests in your Web performance test. The HTTP response is the data of your Web performance test, that is, the data that tells you if your Web application is working correctly or not.

Note

Validation and extraction rules that you add to your test are executed against the HTTP response.

The Web Performance Test Results Viewer also contains a tab with an embedded browser control. The browser control attempts to display the HTTP response for each of the requests in your Web performance test. Because the Web performance test engine does not execute JavaScript, the embedded browser control is set not to run JavaScript.

Some Web sites contain a noscript tag in their HTML. This tag allows a Web site to specify an error message that a browser will display if the browser is set not to run JavaScript. If a Web site contains a noscript tag, you might see an error message, such as JavaScript required, in the Web Performance Test Results Viewer when you run your test. The error message means that the page is not displaying correctly in the viewer, but most of the time the response will still be correct. You should examine the HTTP response to determine whether your Web test is working correctly.

Note

You can also add validation rules to determine whether your Web performance test is working correctly.

JavaScript and Coded Web Performance Tests

Some Web applications depend on JavaScript in ways that affect the HTTP requests. You can use coded a Web performance test to simulate the logic typically performed by JavaScript. For example, an application might use JavaScript to dynamically modify form parameters. In a coded Web performance test you can write code to make the same modifications to form parameters manually. For more information, see How to: Create a Coded Web Performance Test.

ActiveX Controls

ActiveX controls in your Web application will fall into three categories, depending on how they work at the HTTP level.

  • Your ActiveX control is not doing any work at the HTTP level, and is just displaying something visual on the page. In this case, you will not have to add any special handling to your Web performance test.

  • Your ActiveX control is not doing any work at the HTTP level, but you want to test it. For example if you have a very large ActiveX control, you might want to test it in a load test to see whether it is affecting the speed of your Web application. In this case, add the ActiveX control as a dependent request to the page, and it will be downloaded during the test run.

  • Your ActiveX control is doing work at the HTTP level, for example retrieving data from a Web service. In this case, you must convert your test to a coded Web performance test and add the HTTP requests manually.

See Also

Tasks

Troubleshooting Web Performance Tests

How to: Create a Coded Web Performance Test

Walkthrough: Creating a Coded Web Performance Test

Concepts

Running Web Performance Tests

Using Validation and Extraction Rules in Web Performance Tests

Other Resources

Troubleshooting Load and Web Performance Tests

Creating and Editing Web Performance Tests