Differences between revisions 2 and 3
Revision 2 as of 2005-03-08 15:31:29
Size: 2127
Comment:
Revision 3 as of 2009-09-20 21:56:25
Size: 2138
Editor: localhost
Comment: converted to 1.6 markup
Deletions are marked like this. Additions are marked like this.
Line 3: Line 3:
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 [:../BuildWebTest: Building a Web Test Plan].
[[Anchor(urlrewriting)]]
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 [[../BuildWebTest| Building a Web Test Plan]].
<<Anchor(urlrewriting)>>
Line 13: Line 13:
 [http://jakarta.apache.org/jmeter/demos/URLRewritingExample.jmx Download] this example . In Figure 1 is shown a test plan using URL rewriting. Note that the URL Re-writing modifier is attached to the ThreadGroup, thus assuring that it will affect every request in that ThreadGroup.  [[http://jakarta.apache.org/jmeter/demos/URLRewritingExample.jmx|Download]] this example . In Figure 1 is shown a test plan using URL rewriting. Note that the URL Re-writing modifier is attached to the ThreadGroup, thus assuring that it will affect every request in that ThreadGroup.
Line 15: Line 15:
 http://jakarta.apache.org/jmeter/images/screenshots/url_rewrite_example_a.png [[BR]]  {{http://jakarta.apache.org/jmeter/images/screenshots/url_rewrite_example_a.png}} <<BR>>
Line 20: Line 20:
 http://jakarta.apache.org/jmeter/images/screenshots/url_rewrite_example_b.gif [[BR]]  {{http://jakarta.apache.org/jmeter/images/screenshots/url_rewrite_example_b.gif}} <<BR>>
Line 22: Line 22:
[[Anchor(headermanager)]] <<Anchor(headermanager)>>

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.

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. Use the appropriate HTTP URL Re-writing Modifier to accomplish this. Simply enter the name of your session ID parameter into the modifier, and it will find it and add it to each request. If the request already has a value, it will be replaced.

  • URL Rewriting Example

    Download this example . In Figure 1 is shown a test plan using URL rewriting. Note that the URL Re-writing modifier is attached to the ThreadGroup, thus assuring that it will affect every request in that ThreadGroup.

    http://jakarta.apache.org/jmeter/images/screenshots/url_rewrite_example_a.png
    Figure 1 - Test Tree

In Figure 2, we see the URL Re-writing modifier GUI, which just has a field for the user to specify the name of the session ID parameter. There is also a checkbox for indicating that the session ID should be part of the path (separated by a ";"), rather than a request parameter

  • http://jakarta.apache.org/jmeter/images/screenshots/url_rewrite_example_b.gif
    Figure 2 - Request parameters

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.

UserManual/BuildAdvancedWeb (last edited 2009-09-20 21:56:25 by localhost)