<commit_before><?xml version="1.0"?>
<!--
   $Header$
   Copyright 2001-2004 The Apache Software Foundation
 
   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License at
 
       http://www.apache.org/licenses/LICENSE-2.0
 
   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.
-->
	
<document prev="build-web-test-plan.html" next="build-db-test-plan.html" date="$Date$">

<properties>
  <title>User's Manual: Building an Advanced Web Test Plan</title>
</properties>

<body>

<section name="6. Building an Advanced Web Test Plan" anchor="building">
<p>In this section, you will learn how to create advanced
<a href="build-test-plan.html">Test Plans</a> to test a Web site.</p>

<p>For an example of a basic Test Plan, see
<a href="build-web-test-plan.html">Building a Web Test Plan</a>.</p></section>

<section name="6.1 Handling User Sessions With URL Rewriting" anchor="session_url_rewriting">
<p>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.</p>
<p>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 <complink name="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.
If "Cache Session Id?" is checked, then the last found session id will be saved,
and will be used if the previous HTTP sample does not contain a session id.
</p>

<example title="URL Rewriting Example">
<p>Download <a href="../demos/URLRewritingExample.jmx">this example</a>. 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.</p>
<figure image="url_rewrite_example_a.png">Figure 1 - Test Tree</figure>
<p>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</p>
<figure image="url_rewrite_example_b.png">Figure 2 - Request parameters</figure>
</example>
</section>

<section name="6.2 Using a Header Manager" anchor="header_manager">
<p>The <complink name="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.</p>
<p>The <complink name="HTTP Header Manager"/>, like the <complink name="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 <complink name="HTTP Request"/> objects in
your test.</p>

</section>

</body>
</document><commit_msg>Fix do to agree with picture. TODO - fix example and picture to be more useful (login should be outside SimpleController)<commit_after><?xml version="1.0"?>
<!--
   $Header$
   Copyright 2001-2004 The Apache Software Foundation
 
   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License at
 
       http://www.apache.org/licenses/LICENSE-2.0
 
   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.
-->
	
<document prev="build-web-test-plan.html" next="build-db-test-plan.html" date="$Date$">

<properties>
  <title>User's Manual: Building an Advanced Web Test Plan</title>
</properties>

<body>

<section name="6. Building an Advanced Web Test Plan" anchor="building">
<p>In this section, you will learn how to create advanced
<a href="build-test-plan.html">Test Plans</a> to test a Web site.</p>

<p>For an example of a basic Test Plan, see
<a href="build-web-test-plan.html">Building a Web Test Plan</a>.</p></section>

<section name="6.1 Handling User Sessions With URL Rewriting" anchor="session_url_rewriting">
<p>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.</p>
<p>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 <complink name="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.
If "Cache Session Id?" is checked, then the last found session id will be saved,
and will be used if the previous HTTP sample does not contain a session id.
</p>

<example title="URL Rewriting Example">
<p>Download <a href="../demos/URLRewritingExample.jmx">this example</a>. In Figure 1 is shown a 
test plan using URL rewriting.  Note that the URL Re-writing modifier is added to the SimpleController,
thus assuring that it will only affect requests under that SimpleController.</p>
<figure image="url_rewrite_example_a.png">Figure 1 - Test Tree</figure>
<p>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</p>
<figure image="url_rewrite_example_b.png">Figure 2 - Request parameters</figure>
</example>
</section>

<section name="6.2 Using a Header Manager" anchor="header_manager">
<p>The <complink name="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.</p>
<p>The <complink name="HTTP Header Manager"/>, like the <complink name="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 <complink name="HTTP Request"/> objects in
your test.</p>

</section>

</body>
</document>
{'fraction_non_alphanumeric': 0.09009009009009009, 'fraction_numerical': 0.0066841034582970065, 'mean_word_length': 4.475735879077168, 'pattern_counts': {'":': 0, '<': 101, '<?xml version=': 2, '>': 101, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 2}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3424506', 'n_tokens_mistral': 1912, 'n_tokens_neox': 1832, 'n_words': 938}