About Overview Download Releases Download Nightly Tarball Changes Known Bugs License TODO Contributors Documentation User Manual Developer Manual JMeter Wiki Community Get Involved Mailing Lists CVS Repositories |
HTTP Proxy Server to record browser requests
To use the proxy server, create a Threadgroup in your testplan or workbench. In the Threadgroup, add the Proxy Server (it will be an option under Config Elements). 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).
Configuring the Proxy Server
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. 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. If the Include field is left empty, then all requests will "pass" the include test. If the Exclude field is left empty, then all request will "pass" the exclude test. Once the Include field has at least one entry, then only those requests that match at least one entry will "pass" ("pass" means "be recorded"). 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. To add an entry to the Include or Exclude field, type the entry into the text field, and hit "Enter" 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 "clear" button. Currently, there is no way to individually select items and delete them. 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: "jakarta.apache.org/jmeter/index.html". Thus, if you wanted to include all .html files, you're regular expression might look like: ".*\.html". Using a combination of includes and excludes, you should be able to record what you are interested in and skip what you are not. When you are ready to begin, hit "start".
Where do the samples get recorded to?
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. If there are no Simple Controllers in your test plan, then no samples will be recorded.
All Done
When you are done recording your test samples, stop the proxy server (hit the "stop" 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.
Example test tree
Copyright © 1999-2001, Apache Software Foundation