About

Documentation

Community

6. Building an Advanced Web Test Plan

In this section, you will learn how to create advanced Test Plans to test a Web site.

For an example of a basic Test Plan, see Building a Web Test Plan .


6.1 Handling User Sessions With URL Rewriting

If your web application uses URL rewriting rather than cookies to save session information, then you'll need to do a bit of extra work to test your site.

To respond correctly to URL rewriting, JMeter needs to parse the HTML received from the server and retrieve the unique session ID. To do this, put all your requests inside a Modification Manager , with an HTML Link Parser attached. Then, include the session ID as an additional parameter with each HTTP Request , with ".*" as the value.

URL Rewriting Example

Download this example . In Figure 1 is shown a test plan using URL rewriting. Note that all HTTP Requests are contained within the Modification Manager . The Modification Manager also has an HTML Link Parser attached to it.

It would be possible to use other Logic Controllers within the Modification Manager without affecting the Modification Manager.


Figure 1 - Test Tree

In Figure 2, we see the "Send Parameters with Request" section of one of the HTTP Request objects. It shows, in addition to the login information, the SESSION_ID parameter, with a value of ".*", which is a regular expression that will match any string. Your application will have its own unique name for this parameter, which you will have to put in place of "SESSION_ID".


Figure 2 - Request parameters


6.2 Using a Header Manager

The HTTP Header Manager lets you customize what information JMeter sends in the HTTP request header. This header includes properties like "User-Agent", "Pragma", "Referer", etc.

The HTTP Header Manager , like the HTTP Cookie Manager , should probably be added at the Thread Group level, unless for some reason you wish to specify different headers for the different HTTP Request objects in your test.



Copyright © 1999-2001, Apache Software Foundation