<?xml version="1.0"?>
<document>
  <properties>
	 <author email="mstover1@apache.org">Michael Stover, et al.</author>
	 <title>HTTP Proxy Server</title>
  </properties>
<body>
<section name="HTTP Proxy Server to record browser requests">
<p>To use the proxy server, create a Threadgroup in your testplan or workbench.
In the Threadgroup, <i>add</i> the Proxy Server (it will be an option under Config Elements).</p>
<p>
The Proxy Server allows JMeter to watch and record your actions while you browse your web application
with your normal browser (such as Internet Explorer).  JMeter will create test sample objects and store them
directly into your test plan as you go (so you can view samples interactively while you make them).</p>
</section>
<section name="Configuring the Proxy Server">
<p>
There are a few simple options in the Proxy Server's configuration screen that give you some control over the Proxy's
behavior.  First, you can select the port that the Proxy Server listens to.  8080 is the default, but you can change it
if that port is already in use on your machine.</p>
<p>
The Include and Exclude fields allow you to filter requests.  If, for example, you left both fields blank, then JMeter
would record every action of your browser.  This can often result in 20+ test samples being recorded for each web page
(it will record all image requests, CSS files, Javascript files, etc).  This is probably not desirable (there are better
ways to tell JMeter to download the images from a page).  The Include/Exclude fields give you some say over what gets
recorded.  </p>
<p>
If the Include field is left empty, then all requests will &quot;pass&quot; the include test.  If the Exclude field is
left empty, then all request will &quot;pass&quot; the exclude test.  Once the Include field has at least one entry,
then only those requests that match at least one entry will &quot;pass&quot; (&quot;pass&quot; means &quot;be
recorded&quot;). </p>
<p>
If the Exclude field is left empty, then all requests (that have passed the Include field check) will pass.  If there are
entries in the Exclude field, then any request that matches at least one entry will not be recorded.
</p>
<p>
To add an entry to the Include or Exclude field, type the entry into the text field, and hit &quot;Enter&quot; when done.
The text will be added to the List box to the right of the text field.  To clear the text field, hit the &quot;clear&quot;
button.  Currently, there is no way to individually select items and delete them.
</p>
<p>
These entries will be treated as Perl-type regular expressions.  They will be matched against the host name + the path of
each browser request.  Thus, if the URL you are browsing is http://jakarta.apache.org/jmeter/index.html?username=xxxx,
then the regular expression will be tested against the string: &quot;jakarta.apache.org/jmeter/index.html&quot;.  Thus,
if you wanted to include all .html files, you're regular expression might look like: &quot;.*\.html&quot;.  Using a
combination of includes and excludes, you should be able to record what you are interested in and skip what you are
not.</p>
<p>
When you are ready to begin, hit &quot;start&quot;.</p>
</section>
<section name="Where do the samples get recorded to?">
<p>
The samples will be recorded as Web Test controllers under any Simple Controller elements in your tree (note, if you have more than one
Simple Controller, they will all have duplicate Web Test controllers created for them).  If your Simple Controller has a
Url Sample element with domain or path settings, then your Web Test controllers will be created with blank domain and/or path settings (provided
they match, of course).  This allows you to simply create test plans with a single top level config element to control which server name is
being tested.<br/>
If there are no Simple Controllers in your test plan, then no samples will be recorded.
</p>
</section>
<section name="All Done">
<p>
When you are done recording your test samples, stop the proxy server (hit the &quot;stop&quot; button).  Remember to reset
your browser's proxy settings.  Now, you may want to sort and re-order the test script, add timers, listeners, a
cookie manager, etc.  </p>

</section>
<section name="Example test tree">
<img src="/images/screenshots/proxy_control.gif" width="644" height="303"/>
</section>
</body>
</document>