User's Manual Click on the section name to go straight to the section.

Click on the "+" to go to the relevant section of the detailed section list, where you can select individual subsections. Section Summary
• • • • • • • • • • • • • • • • • • • • • • • •

Changes + ... 1. Introduction + ... 2. Getting Started + ... 3. Building a Test Plan + ... 4. Elements of a Test Plan + ... 5. Building a Web Test Plan + ... 6. Building an Advanced Web Test Plan + ... 7. Building a Database Test Plan + ... 8. Building an FTP Test Plan + ... 9a. Building an LDAP Test Plan + ... 9b. Building an Extended LDAP Test Plan + ... 10. Building a Webservice Test Plan + ... 11. Building a JMS Point to point Test Plan + ... 12. Building a JMS Topic Test Plan + ... 13. Building a Monitor Test Plan + ... 14. Listeners + ... 15. Remote Testing + ... 16. Best Practices + ... 17. Help! My boss wants me to load test our web app! + ... 18. Component Reference + ... 19. Functions + ... 20. Regular Expressions + ... 21. Hints and Tips + ... 22. Glossary

Detailed Section List

1. Introduction o 1.1 History o 1.2 The Future 2. Getting Started o 2.1 Requirements  2.1.1 Java Version  2.1.2 Operating Systems o 2.2 Optional  2.2.1 Java Compiler  2.2.2 SAX XML Parser  2.2.3 Email Support  2.2.4 SSL Encryption  2.2.5 JDBC Driver  2.2.6 Apache SOAP  2.2.7 BeanShell  2.2.8 Libraries for ActiveMQ 3.0

2.3 Installation  2.3.1 Downloading the Latest Release  2.3.2 Downloading Nightly Builds o 2.4 Running JMeter  2.4.1 JMeter's Classpath  2.4.2 Using a Proxy Server  2.4.3 Non-GUI Mode  2.4.4 Distributed Mode  2.4.5 Overriding Properties Via The Command Line  2.4.6 Logging and Error Messages  2.4.7 Full list of command-line options o 2.5 Configuring JMeter 3. Building a Test Plan o 3.1 Adding and Removing Elements o 3.2 Loading and Saving Elements o 3.3 Configuring Tree Elements o 3.4 Saving the Test Plan o 3.5 Running a Test Plan o 3.6 Error reporting 4. Elements of a Test Plan o 4.1 Thread Group o 4.2 Controllers  4.2.1 Samplers  4.2.2 Logic Controllers o 4.3 Listeners o 4.4 Timers o 4.5 Assertions o 4.6 Configuration Elements o 4.7 Pre-Processor Elements o 4.8 Post-Processor Elements o 4.9 Execution order o 4.10 Scoping Rules o 4.11 Properties and Variables o 4.12 Using Variables to parameterise tests 5. Building a Web Test Plan o 5.1 Adding Users o 5.2 Adding Default HTTP Request Properties o 5.3 Adding Cookie Support o 5.4 Adding HTTP Requests o 5.5 Adding a Listener to View/Store the Test Results o 5.6 Logging in to a web-site 6. Building an Advanced Web Test Plan o 6.1 Handling User Sessions With URL Rewriting o 6.2 Using a Header Manager 7. Building a Database Test Plan o 7.1 Adding Users o 7.2 Adding JDBC Requests o 7.3 Adding a Listener to View/Store the Test Results
o

• • • • • • •

• • • • • •

8. Building an FTP Test Plan o 8.1 Adding Users o 8.2 Adding Default FTP Request Properties o 8.3 Adding FTP Requests o 8.4 Adding a Listener to View/Store the Test Results 9a. Building an LDAP Test Plan o 9a.1 Adding Users o 9a.2 Adding Login Config Element o 9a.3 Adding LDAP Request Defaults o 9a.4 Adding LDAP Requests o 9a.5 Adding a Listener to View/Store the Test Results 9b. Building an Extended LDAP Test Plan o 9b.1 Adding Users o 9b.2 Adding LDAP Extended Request Defaults o 9b.3 Adding LDAP Requests o 9b.4 Adding a Listener to View/Store the Test Results 10. Building a Webservice Test Plan 11. Building a JMS Point to point Test Plan 12. Building a JMS topic Test Plan 13. Building a Monitor Test Plan 14. Listeners 15. Remote Testing 16. Best Practices o 16.1 Limit the Number of Threads o 16.2 Where to Put the Cookie Manager o 16.3 Where to Put the Authorization Manager o 16.4 Using the Proxy Server to record test scripts o 16.5 User variables o 16.6 Reducing resource requirements o 16.7 BeanShell server o 16.8 BeanShell scripting o 16.9 Developing script functions in BeanShell, Javascript or Jexl etc. o 16.10 Parameterising tests 17. Help! My boss wants me to load test our web app! 18. Component Reference 19. Functions 20. Regular Expressions 21. Hints and Tips 22. Glossary

FTP servers . The primary goal of further development is to make JMeter the most useful regression testing tool as possible. JMeter can help you regression test your application by letting you create test scripts with assertions to validate that your application is returning the results you expect. 1. need the appropriate JDBC driver from your vendor. of course. network or object to test its strength or to analyze overall performance under different load types. if you are interested in testing a Web application. Introduction Apache JMeter is a 100% pure Java desktop application designed to load test client/server software (such as a web application ). Finally. For example. The other specific Test Plan sections are: • Advanced Web Test Plan .1 History Stefano Mazzocchi of the Apache Software Foundation was the original developer of JMeter.1. Web (HTTP/HTTPS).g. For maximum flexibility. The release contains all of the files you need to build and run most types of tests. but does not include a JMS client implementation. Java. CGI scripts. go through the appropriate section on how to build a specific type of Test Plan. e. you will need to download the appropriate jars from the JMS provider. If you want to perform JDBC testing. See the JMeter Classpath section for details on installing additional jars. JMeter lets you create these assertions using regular expressions. Next. LDAP. JMeter does not come with any JDBC drivers. without compromising JMeter's load-testing capabilities. JDBC. 2.2 The Future We hope to see JMeter's capabilities rapidly expand as developers take advantage of its pluggable architecture. We redesigned JMeter to enhance the GUI and to add functional-testing capabilities. start JMeter and go through the Building a Test Plan section of the User Guide to familiarize yourself with JMeter basics (for example. databases . JMeter includes the JMS API jar. 1. If you want to run JMS tests. Getting Started The easiest way to begin using JMeter is to first download the latest production release and install it. Java Servlets. JMeter can be used to simulate a heavy load on a server. Additionally. and JUnit. It may be used to test performance both on static and dynamic resources such as static files. Java objects. But please note that JMeter is not a browser. adding and removing elements). and more. FTP. then see the section Building a Web Test Plan . He wrote it primarily to test the performance of Apache JServ (a project that has since been replaced by the Apache Tomcat project). then you will.

1.5 or higher. then you will need a fully compliant JDK 1. 2. 2. 2. listeners. NT. 2. You have the option of telling JMeter to use a different XML parser.2 Operating Systems JMeter is a 100% Java application and should run correctly on any system that has a compliant Java implementation.1 Java Compiler If you want to build the JMeter source or develop JMeter plugins. and others) which give you more control over your Test Plans.2. etc) OpenVMS Alpha 7. please do not file bug reports if your JRE fails to run JMeter because of JRE implementation issues.1 Requirements JMeter requires your computing environment meets some minimum requirements. To do so.1 Java Version JMeter requires a fully compliant JVM 1. 2. JMeter has been tested and works under: • • • Unix (Solaris.5 or higher. assertions.3+ 2. Because JMeter uses only standard Java APIs. etc) Windows (98. XP. then you will need one or more optional packages listed below.• • • • • • • JDBC FTP JMS Point-to-Point JMS Topic LDAP LDAP Extended WebServices (SOAP) Once you are comfortable with building and running JMeter Test Plans. Linux.2. you can look into the various configuration elements (timers.2 Optional If you plan on doing JMeter development. include the classes for the third-party parser in .2 SAX XML Parser JMeter comes with Apache's Xerces XML parser .1.

2.2. this requires the javax/management/j2ee classes which can be found in the Apache Geronimo jar geronimo- .4 The SMTP sampler can optionally use a local trust store or trust all certificates. as is the case with Sun Java 1. so you just need to add the appropriate JMS Client implementation jar(s) from the JMS provider. regardless of validity periods etc.6 JMS client JMeter now includes the JMS API from Apache Geronimo. update system.5 JDBC Driver You will need to add your database vendor's JDBC driver to the classpath if you want to do JDBC testing.JMeter's classpath . and update the jmeter.2. JMeter HTTP defaults to protocol level TLS. add the jar activemq-core-5. The JMeter HTTP samplers are configured to accept all certificates. There may also be some information on the JMeter Wiki .3. not a zip. There is also the SSL Manager .3.3 Email Support JMeter has extensive Email capabilities.default.properties.properties file with the full classname of the parser implementation. If the server requires a client certificate. The JMeter proxy server (see below) supports recording HTTPS (SSL) in versions after 2.3.2. the current version of ActiveMQ is 5. whether trusted or not. and has a POP3(S)/IMAP(S) sampler. Make sure the file is a jar file. for greater control of certificates.4 and above.2. Include the necessary encryption packages in JMeter's classpath . This is to allow the maximum flexibility in testing servers. 2. 2. It also has an SMTP sampler. Also.jar to the classpath. JMeter requires that an implementation of SSL be provided.7 Libraries for ActiveMQ JMS At the time of writing.2. This can be changed by editting the JMeter property "https.g. It can send email based on test results.4 SSL Encryption To test a web server using SSL encryption (HTTPS). Please refer to their documentation for details.2. 2.2. You will need to add the jar activemq-all-5.3. If your version of Java does not include SSL support. then it is possible to add an external implementation. e.jar to your classpath.properties to register the SSL Provider. 2. by storing it in the lib/ directory.protocol" in jmeter.properties or user. Alternatively.2. this can be provided.

The other required jars (such as commons-logging) are already included with JMeter.drop a JMX file on this to run a non-GUI test remotely • jmeter-t.3.0.bat .3. Note: there can be problems (especially with client-server mode) if the directory path contains any spaces. but do not change any of the sub-directory names.1): jakarta-jmeter-2.bat .drop a JMX file on this to load it in GUI mode • jmeter-server.1/lib/junit jakarta-jmeter-2.3 Installation We recommend that most users run the latest release . the JMeter GUI should appear.4 Running JMeter To run JMeter.cmd .1/lib/ext jakarta-jmeter-2.1/docs jakarta-jmeter-2.org/initial-configuration.drop a JMX file on this to run a non-GUI test jmeter-n-r.bat (for Windows) or jmeter (for Unix) file.1 jakarta-jmeter-2. jakarta-jmeter-2.3.apache.j2ee-management_1. These files are found in the bin directory.3.CMD files require Win2K or later): jmeter.3. Provided that you have a JRE/JDK correctly installed and the JAVA_HOME environment variable set.3.3.cmd . simply unzip the zip/tar file into the directory where you want JMeter to be installed. See http://activemq. See the JMeter Classpath section for more details on installing additional jars. there is nothing more for you to do.3.start JMeter in server mode • • • . 2.e. run the jmeter.jar.3.run JMeter (in GUI mode by default) jmeter-n. After a short pause.1/printable_docs You can rename the parent directory (i.0_spec-1.1/bin jakarta-jmeter-2.1) if you want.1/extras jakarta-jmeter-2. There are some additional scripts in the bin directory that you may find useful. To install a release build.cmd .1/lib/ jakarta-jmeter-2. 2.html for details. The installation directory structure should look something like this (for version 2. Windows script files (the .3.

Run the Shutdown client to stop a non-GUI instance abruptly • • Note: the special name LAST can be used with jmeter-n.Run the Shutdown client to stop a non-GUI instance gracefully • stoptest.mirror-server. jmeter-t. The environment variable JVM_ARGS can be used to override JVM settings in the jmeter. JMeter will automatically find JMeter components in any jars found here. Defines some JVM settings which may not work for all JVMs.runs the JMeter Mirror Server in non-GUI mode • shutdown.sh .cmd and jmeter-nr.sh .Run the Shutdown client to stop a non-GUI instance gracefully • stoptest.sh .] will override the HEAP settings in the script. should work on most Linux/Unix systems: jmeter .cmd.start JMeter in server mode (calls jmeter script with appropriate parameters) • jmeter.jmx . • mirror-server. for example: JVM_ARGS="-Xms1024m -Xmx1024m" jmeter -t test.cmd . Support jars (libraries etc) should be placed in the lib directory.bat script.used for JMeter components and add-ons If you have developed new JMeter components. Un*x script files. ..run JMeter (in GUI mode by default).cmd . then you should jar them and copy the jar into JMeter's lib/ext directory. The JVM_ARGS environment variable can be used to override or set additional JVM options.Run the Shutdown client to stop a non-GUI instance abruptly • It may be necessary to edit the jmeter shell script if some of the JVM options are not supported by the JVM you are using.cmd and means the last test plan that was run interactively. For example: set JVM_ARGS="-Xms1024m -Xmx1024m -Dpropname=propvalue" jmeter -t test.very basic JMeter script with no JVM options specified.sh .jmx [etc. 2.1 JMeter's Classpath JMeter automatically finds classes from jars in the following directories: • • JMETER_HOME/lib ..4.runs the JMeter Mirror Server in non-GUI mode shutdown. • jmeter-server .cmd .used for utility jars JMETER_HOME/lib/ext .

properties Note that setting the CLASSPATH environment variable will have no effect.if required] -a [password for proxy authentication . 2. and the java command silently ignores the CLASSPATH variable.proxy. and the -classpath/-cp options when -jar is used. then define the property search_paths in jmeter. This is because JMeter is started with "java -jar".bat/jmeter file from a command line with the following parameters: -H [proxy server hostname or ip address] -P [proxy server port] -N [nonproxy hosts] (e.4. Other jars (such as JDBC. not .3 Non-GUI Mode (Command Line mode) For non-interactive testing. [This occurs with all Java programs. --proxyPort.2 Using a Proxy Server If you are testing from behind a firewall/proxy server.jar files.1. *. This is not to be confused with the proxy settings described above.properties. To do so. You can also install utility Jar files in $JAVA_HOME/jre/lib/ext.classpath in jmeter.zip.if required] Example : jmeter -H my. run the jmeter. you can use --proxyHost. you may choose to run JMeter without the GUI.1) you can set the property user. you may need to provide JMeter with the firewall/proxy server hostname and port number. which are used when JMeter makes HTTP or HTTPS requests itself. or (since 2. Do not use lib/ext for utility jars.org|localhost) -u [username for proxy authentication .g. use the following command options .server -P 8000 -u username -a password -N localhost Alternatively. it is only intended for JMeter components. JMS implementations and any other support libaries needed by the JMeter code) should be placed in the lib directory . which can be used for recording HTTP or HTTPS browser sessions. not just JMeter. To do so. and --password JMeter also has its own in-built HTTP Proxy Server .not the lib/ext directory Note: JMeter will only find .apache.4. --username.] 2.If you don't want to put JMeter extension jars in the lib/ext directory.

server2 . -l [name of JTL file to log sample results to].5 Overriding Properties Via The Command Line .4.jmx -l log. use the following command: jmeter -n -t testplan.proxy.jtl -H my. To run the test from the client in non-GUI mode. -r Run the test in the servers specified by the JMeter property "remote_hosts" -R [list of remote servers] Run the test in the specified remote servers The script also lets you specify the optional firewall/proxy server information: -H [proxy server hostname or ip address] -P [proxy server port] Example : jmeter -n -t my_test.4 Server Mode For distributed testing .exitaftertest=true.4.jmx -r [-Gprop=val] [-Gglobal.-n This specifies JMeter is to run in non-gui mode -t [name of JMX file that contains the Test Plan].bat on each server host. then define the JMeter property server. You can also use non-GUI mode to run remote tests. run jmeter-server/jmeter-server.server -P 8000 2.server -P 8000 If you want the server to exit after a single test has been run. -j [name of JMeter run log file]. run JMeter in server mode on the remote node(s).proxy.can be used instead of -r to provide a list of servers to start Overrides remote_hosts. but does not define the property. To start the server(s). 2. and then control the server(s) from the GUI.properties] [-Z] where: -G is used to define JMeter properties to be set in the servers -X means exit the servers at the end of the test -Rserver1. The script also lets you specify the optional firewall/proxy server information: -H [proxy server hostname or ip address] -P [proxy server port] Example : jmeter-server -H my.

-J[prop name]=[value] . -L[category]=[priority] . a message will be written to the log file. The jmeter scripts that take a test plan name as a parameter (e.jmx the log file is set to . It therefore allows the default of jmeter. instead the reference is just used as is. 2.Java system properties.log to be overridden. and before any further properties are processed.1 -Ljmeter.0.2 added a new command-line option.defines a java system property value. JMeter versions after 2.defines a local JMeter property. -G[propertyfile] .g. If JMeter detects an error during a test.0. The -L flag can also be used without the category name to set the root logging level. It defaults to jmeter. See Functions and Variables for more information .defines a file containing JMeter properties to be sent to all remote servers. see below).6 Logging and error messages JMeter does not generally use pop-up dialog boxes for errors. and logging properties can be overriden directly on the command line (instead of modifying jmeter.log . The log file name is defined in the jmeter. -j jmeterlogfile. Attempts to use the -J flag to update log_level or log_file properties will have no effect. but after the logging system has been set up.dir=/home/mstover/jmeter_stuff \ -Jremote_hosts=127. To do so.g. jmeter-n. e.4. Nor does it report any error for a mis-spelt variable or function. JMeter properties. setting a particular category to the given priority level. Examples : jmeter -Duser. and will be found in the directory from which JMeter was launched.cmd) have been updated to define the log file using the test plan name. as these would interfere with running tests. -G[prop name]=[value] .defines a JMeter property to be sent to all remote servers. The command line properties are processed early in startup.properties file (or using the -j option.overrides a logging setting.B.properties).engine=DEBUG jmeter -LDEBUG N. for the test plan Test27. use the following options: -D[prop_name]=[value] . This is processed after the initial properties file is read.

the file may appear as just jmeter unless you have set Windows to show file extensions.JMeterThread: Thread BSH1-1 . --proxyHost {argument} Set a proxy server for JMeter to use .. --propfile {argument} the jmeter property file to use -q.Load: Loading file: .jmeter.jmeter.] As well as recording errors. --jmeterlogfile {argument} the jmeter log file -l. 2.jmeter. --logfile {argument} the file to log samples to -n.StandardJMeterEngine: Test The log file can be helpful in determining the cause of an error. --help print usage information and exit -v.4.threads.jmeter.log. [Which you should do anyway.9. These are shown below.jmeter.JMeterThread: Thread BSH1-1 .jmeter. --nongui run JMeter in nongui mode -s.engine. --addprop {argument} additional property file(s) -t..jmx) file to run -j.engine. to make it easier to detect viruses and other nasties that pretend to be text files. --version print the version information and exit -p.action.gui. INFO . --testfile {argument} the jmeter test(. as JMeter does not interrupt a test to display an error dialogue.StandardJMeterEngine: Running INFO .StandardJMeterEngine: INFO INFO INFO .log file records some information about the test run. For example: 10/17/2003 12:19:20 PM 10/17/2003 12:19:45 PM c:\mytestfiles\BSH.20031002 . --server run the JMeter server -H. -h.jmeter.engine.jmx 10/17/2003 12:19:52 PM the test! 10/17/2003 12:19:52 PM Starting 1 threads for 10/17/2003 12:19:52 PM Continue on error 10/17/2003 12:19:52 PM started 10/17/2003 12:19:52 PM is done 10/17/2003 12:19:52 PM has ended INFO INFO INFO .engine. Ramp up = 1.JMeter: Version 1.threads.jmeter.Test27.StandardJMeterEngine: group BSH. When running on Windows.7 Full list of command-line options Invoking JMeter as "jmeter -?" will print a list of all the command-line options. the jmeter.

--username {argument} Set username for proxy server that JMeter is to use -a. -j or -l flags.g.g. --proxyPort {argument} Set proxy server port for JMeter to use -u. --systemproperty {argument}={value} Define additional System properties -S. 'jmeter_'yyyyMMddHHmmss'. jorphan=INFO or jmeter. . --remotestart server1. --jmeterproperty {argument}={value} Define additional JMeter properties -G.properties and specify it in the command line. --homedir {argument} the jmeter home directory to use -X..properties -D.e. --systemPropertyFile {filename} a property file to be added as System properties -L.g. --remoteexit Exit the remote servers at end of test (non-GUI) Note: the JMeter log file name is formatted as a SimpleDateFormat (applied to the current date) if it contains paired single-quotes. Note: since 2. --runremote (non-GUI only) Start remote servers (as defined by the jmeter property remote_hosts) -R.util=DEBUG -r.log' If the special name LAST is used for the -t. --globalproperty (argument)[=(value)] Define Global properties (sent to servers) e. 2.properties in the /bin directory or create your own copy of the jmeter.properties .2. The file will be automatically loaded if it is found in the current directory or if it is found in the JMeter bin directory. --password {argument} Set password for proxy server that JMeter is to use -J. -Gport=123 or -Gglobal. then JMeter takes that to mean the last test plan that was run in interactive mode. system. .properties is used to update system properties...properties which has the default value user.-P. you can define additional JMeter properties in the file defined by the JMeter property user. --loglevel {argument}={value} Define loglevel: [category=]level e.5 Configuring JMeter If you wish to modify the properties with which JMeter runs you need to either modify the jmeter. (non-GUI only) Start these remote servers (overrides remote_hosts) -d. Similarly.

list the machines where you have JMeter remote No servers running.provider xml.xerces. List of paths that JMeter will search for utility classes. You may list their classname or their class label (the string that appears in JMeter's UI) here. The default value is: org.properties Name of file containing additional JMeter properties. These are No added before the -S and -D options are processed.properties. These are added after the initial property file.) that JMeter will search for JMeter add-on classes. user. You can specify an implementation as your XML parser. Building a Test Plan .SAXParser No remote_hosts Comma-delimited list of remote JMeter hosts (or host:port if required). This is in No addition to any jars found in the lib/ext directory. No not_in_menu search_paths user. As JMeter has more and more components added. This will allow you to control those servers from this machine's GUI A list of components you do not want to see in JMeter's menus. If you are running JMeter in a distributed environment.apache. This is in addition to any jars found in the lib directory.properties is loaded system. you may wish to customize your JMeter to show only those components No you are interested in. The command line options and properties files are processed in the following order: • • • • • • • -p propfile jmeter.classpath user.properties system.Parameters Attribute ssl. and they will no longer appear in the menus. Name of file containing additional system properties. for example additional samplers.properties files for further information on other settings you can change.properties and system.properties is loaded all other command-line options are processed See also the comments in the jmeter. List of paths (separated by .parser Description Required You can specify the class for your SSL implementation if you No don't want to use the built-in Java implementation.parsers.properties (or the file from the -p option) is then loaded -j logfile Logging is initialised user. 3. but before the -q and -J No options are processed.

The workbench is not automatically saved with the test plan. we recommend that you save the Test Plan to a file before running it. Choose the file where your elements are saved. right-click on the element. What can be configured for an element depends on what type of element it is.3 Configuring Tree Elements Any element in the test tree will present controls in JMeter's right-hand frame. These controls allow you to configure the behavior of that particular test element. Alternatively.A test plan describes a series of steps JMeter will execute when run. 3." option. In this way. assertions. plus all child elements beneath it. and choosing a new element from the "add" list. To remove an element. right click on the existing tree element to which you want to add the loaded element.. JMeter will merge the elements into the tree. timers. 3...1 Adding and Removing Elements Adding elements to a test plan can be done by right-clicking on an element in the tree. JMeter will save the element selected. and select the "merge" option.2 Loading and Saving Elements To load an element from file. listeners. To save the Test Plan." from the File menu . 3. logic conrollers.4 Saving the Test Plan Although it is not required. and configuration elements. select "Save" or "Save Test Plan As . 3. The Test Tree itself can be manipulated by dragging and dropping components around the test tree. you can save test tree fragments and individual elements for later use. but it can be saved separately as above. elements can be loaded from file and added by choosing the "merge" or "open" option. A complete test plan will consist of one or more Thread Groups. right click on an element and choose the "Save Selection As . and choose the "remove" option. To save tree elements. make sure the element is selected.. sample generating controllers.

it shows a small green box at the right hand end of the section just under the menu bar. it is no longer necessary to select the Test Plan element first). it thinks it is). When JMeter is running.2 allow a Stop to be initiated if Shutdown is taking too long. The numbers to the left of the green box are the number of active threads / total number of threads.. • Shutdown (Control + '. many samplers are now Interruptible which means that active samples can be terminated early.threadstop.. The stop command will check that all threads have stopped within the default timeout.stops the threads immediately if possible. In Versions of JMeter after 2. choose "Start" (Control + r) from the "Run" menu item. at least. and then click your right mouse button to access the "Save Selection As .') . or just press Control + '.5 Running a Test Plan To run your test plan. • Versions of JMeter after 2." from the Edit menu. but if it fails. [This can be changed using the JMeter property jmeterengine. These only apply to a locally run test.(with the latest release. then JMeter is running your test plan (or. JMeter allows you to save the entire Test Plan tree or only a portion of it.. select the appropriate Test Plan element and then select "Save Selection As . Alternatively." menu item.3.3.'. The modal shutdown dialog box will remain active until all threads have stopped. they do not include any threads started on remote systems when using client-server mode. If "Start" is disabled.6 Stopping a Test There are two types of stop command available from the menu: Stop (Control + '. The Stop command can be retried..2. then a message is displayed. which is 5000 ms = 5 seconds. Close the Shutdown dialog box and select Run/Stop. 3.requests the threads to stop at the end of any current work. Will not interrupt any active samples. and "Stop" is enabled. select the Test Plan element in the tree from which to start the "branch".wait ] If the threads have not stopped. To save only the elements located in a particular "branch" of the Test Plan tree. 3. . then it is necessary to exit JMeter to clean up. You can also check the "Run" menu.').

Listeners.When running JMeter in non-GUI mode. there is no Menu. HTTP 404 . All controllers and samplers must be under a thread group.'.g. As the name implies. The commands currently supported are: • • Shutdown . in which case they will apply to all the thread groups. Elements of a Test Plan The Test Plan object has a checkbox called "Functional Testing". The consequence is that the file will grow huge quickly. JMeter non-GUI mode will listen for commands on a specific port (default 4445. This option should be off if you are doing stress-testing (it is off by default). This can be useful if you are doing a small run to ensure that JMeter is configured correctly. Sampling errors (e. and that your server is returning the expected results. this data will be written to file. The scripts are to be found in the JMeter bin directory. The controls for a thread group allow you to: • • Set the number of threads Set the ramp-up period .cmd|.graceful shutdown StopTestNow . please check the log file in case any errors have been reported (e. as well as some information on the test run itself. Other elements. may be placed directly under the test plan. If selected.immediate shutdown These commands can be sent by using the shutdown[. The status of a sample result can be seen in the various different Listeners. Just occasionally there may be some errors that JMeter is unable to trap and log.1 ThreadGroup Thread group elements are the beginning points of any test plan. If you have selected a file in your test listeners. So in versions after 2.sh] or stoptest[. Instead these are stored as attributes of the sample result. 4.g. You can also use the Configuration button on a listener to decide what fields to save.7 Error reporting JMeter reports warnings and errors to the jmeter. e. these will appear on the command console. the thread group element controls the number of threads JMeter will use to execute your test.3. and JMeter's performance will suffer. If you are not recording the data to file. 4.port ). this option makes no difference. If a test is not behaving as you expect. and JMeter does not react to keystrokes such as Control + '.sh] script respectively. it will cause JMeter to record the data returned from the server for each sample.file not found) are not normally reported in the log file.cmd|.2. see the JMeter property jmeterengine.nongui. 3.g.log file. perhaps a syntax error in a function call).

By default.9 introduces a test run scheduler . For more information. then each successive thread will be delayed by 4 seconds. the run is stopped. For example. The ramp-up period tells JMeter how long to take to "ramp-up" to the full number of threads chosen. JMeter checks if the end-time has been reached. Click the checkbox at the bottom of the Thread Group panel to reveal extra fields in which you can enter the start and end times of the run. Each thread will start 10 (100/10) seconds after the previous thread was begun. 4. one can use the relative delay and duration fields. add an HTTP Request Sampler if you want JMeter to send an HTTP request. Note that delay overrides start-time. At the end of each cycle. and duration over-rides end-time.• Set the number of times to execute the test Each thread will execute the test plan in its entirety and completely independently of other test threads. otherwise the test is allowed to continue until the iteration limit is reached. and if so.2 Controllers JMeter has two types of Controllers: Samplers and Logical Controllers. When the test is started. JMeter will wait if necessary until the start-time has been reached. see Logical Controllers . you can add an Interleave Logic Controller to alternate between two HTTP Request Samplers. Version 1. the thread group is configured to loop once through its elements. and the ramp-up period is 100 seconds. These drive the processing of a test. and short enough that the last threads start running before the first ones finish (unless one wants that to happen). If 10 threads are used. . see Samplers . Ramp-up needs to be long enough to avoid too large a work-load at the start of a test. Samplers tell JMeter to send requests to a server. You can also customize a request by adding one or more Configuration Elements to a Sampler. then JMeter will take 100 seconds to get all 10 threads up and running. Alternatively. Start with Ramp-up = number of threads and adjust up or down as needed. Logical Controllers let you customize the logic that JMeter uses to decide when to send requests. For example. If there are 30 threads and a ramp-up period of 120 seconds. Multiple threads are used to simulate concurrent connections to your server application. For more information.

4. and so on.2 Logic Controllers Logic Controllers let you customize the logic that JMeter uses to decide when to send requests. consider the following test tree: • Test Plan o Thread Group  Once Only Controller  Login Request (an HTTP Request )  Load Search Page (HTTP Sampler)  Interleave Controller . Logic Controllers can change the order of requests coming from their child elements. consider using a Defaults Configuration Element. If you are going to send multiple requests of the same type (for example. but the page may have errors on it or may be missing sections. add an Assertion to the sampler.2.1 Samplers Samplers tell JMeter to send requests to a server and wait for a response. Remember to add a Listener to your test plan to view and/or store the results of your requests to disk. For example. To understand the effect of Logic Controllers on a test plan. etc. Each controller has one or more Defaults elements (see below). JMeter lets you create these assertions using regular expressions. They are processed in the order they appear in the tree. in stress testing a web application. JMeter's built-in samplers 4. cause JMeter to repeat requests. HTTP Request) to the same server. You could add assertions to check for certain HTML tags.2. common error strings. the server may return a successful "HTTP Response" code. If you are interested in having JMeter perform basic validation on the response of your request. They can modify the requests themselves. JMeter samplers include: • • • • • • • FTP Request HTTP Request JDBC Request Java object request LDAP Request SOAP/XML-RPC Request WebService (SOAP) Request Each sampler has several properties you can set. You can further customize a sampler by adding one or more Configuration Elements to the Test Plan. Controllers can be used to modify the number of repetitions of a sampler.

both are search requests. It fills in the blanks of any Request that passes through. hitting the same back-end search engine (a servlet or cgi-script. and put that information into the Configuration Element. this time added to the Thread Group itself. search "B"). and instead. you can test your application on a different server simply by changing one field in your Test Plan. we use the Interleave Controller which passes on one child request each time through the test. we ensure that all HTTP requests will share the same cookies. After loading the search page. search "A". Logic Controllers can be combined to achieve various results. you'd have to edit each and every Sampler. Actually. we want to do a search. When the Interleave Controller "passes on" requests from "Search A" or "Search B". not filtered through any Logic Controller. However. Note the HTTP Request Defaults that belongs to the Interleave Controller. we want to re-load the search page itself between each search. Subsequent iterations will skip it. let's say). protocol. but it demonstrates the feature. it uses this Configuration Element exactly as described above.  Search "A" (HTTP Sampler) Search "B" (HTTP Sampler) HTTP default request (Configuration Element) HTTP default request (Configuration Element) Cookie Manager (Configuration Element)    The first thing about this test is that the login request will be executed only the first time through. and arguments. This is just a simple request. but "remembers" its place) of its child elements. the next Sampler loads the search page (imagine a web application where the user logs in. this is a minor benefit at best. . load search. The Thread Group has a built-in Logic Controller. This makes sense . but there could easily have been 8. The next element in the tree is another HTTP default request. Imagine that "Search A" and "Search B" share the same PATH info (an HTTP request specification includes domain. After the login. and then goes to a search page to do a search). So. added to the Thread Group. plus other optional items). A Cookie Manager should be added to all web tests . See the list of built-in Logic Controllers . or 20 child requests. The last element is a HTTP Cookie Manager . By doing so. we can abstract that information out to a single Configuration Element. Instead. This is due to the effects of the Once Only Controller . port. In this case. it will fill in the blanks with values from the HTTP default request Configuration Element. Otherwise. and thus. By adding it at the Thread Group level. method. We could do this by having 4 simple HTTP request elements (load search. we want to do two different searches. path. we leave the PATH field blank for those requests. Interleaving 2 child requests may be overkill. It is extremely useful in web testing to leave the DOMAIN field blank in all your HTTP Sampler elements. It keeps the ordering (ie . put that information into an HTTP default request element.otherwise JMeter will ignore cookies.it doesn't pass one on at random. Rather than configure both HTTP Samplers with the same information in their PATH field.

a JMeter thread sends requests without pausing between each request. Timers can be added as children of samplers or controllers in order to restrict the samplers to which they are applied. Using an assertion. the only difference is in the way the data is presented on the screen. We recommend that you specify a delay by adding one of the available timers to your Thread Group. Additionally.5 Assertions Assertions allow you to assert facts about responses received from the server being tested. To provide a pause at a single place in a test plan.3 Listeners Listeners provide access to the information JMeter gathers about the test cases while JMeter runs. one can use the Test Action Sampler. JMeter could overwhelm your server by making too many requests in a very short amount of time. and whether to use CSV or XML format. There is also a Configuration button which can be used to choose which fields to save. The "View Results Tree" Listener shows details of sampler requests and responses. Other listeners provide summary or aggregation information. They will collect data only from elements at or below their level. and can display basic HTML and XML representations of the response. including directly under the test plan. 4. If you do not add a delay. 4. The Graph Results listener plots the response times on a graph. If you choose to add more than one timer to a Thread Group. you can essentially "test" that your application is returning the results . Every listener in JMeter provides a field to indicate the file to store data to. The timer will cause JMeter to delay a certain amount of time before each sampler which is in its scope .4 Timers By default.4. There are several listeners that come with JMeter. Note that all Listeners save the same data. Listeners can be added anywhere in the test. JMeter takes the sum of the timers and pauses for that amount of time before executing the samplers to which the timers apply. listeners can direct the data to a file for later use.

. and you can indicate that the response is to contain the text. "Web Defaults 1" and "Web Defaults 2". we defined two HTTP Request Defaults elements. a configuration element inside a tree branch has higher precedence than the same element in a "parent" branch. For example. you can assert that the response to a query will contain some particular text. if you place an HTTP Cookie Manager inside a Simple Logic Controller. For instance. You can add an assertion to any Sampler. or that it should match the whole response. Also.6 Configuration Elements A configuration element works closely with a Sampler.you expect it to. since we placed it in the Thread Group (the "parent" of all other branches). The other HTTP requests will use "Web Defaults 2". A configuration element is accessible from only inside the tree branch where you place the element. "</HTML>". If JMeter cannot find the text. For example. only "Web Page 2" can access it. and will count towards the error %age for example in the Aggregate and Summary reports. Note that assertions apply to all samplers which are in its scope . To restrict the assertion to a single sampler. Failed Assertions will also show up in the Tree View and Table Listeners. the Cookie Manager will only be accessible to HTTP Request Controllers you place inside the Simple Logic Controller (see figure 1). Although it does not send requests (except for HTTP Proxy Server ). but not "Web Page 3". To view the assertion results. it can add to or modify requests. For example. 4. JMeter will then check that the text is present in the HTTP response. add an Assertion Listener to the Thread Group. The Cookie Manager is accessible to the HTTP requests "Web Page 1" and "Web Page 2". The text you specify can be a Perl-style regular expression. then it will mark this as a failed request. Since we placed "Web Defaults 1" inside a Loop Controller. you can add an assertion to a HTTP Request that checks for the text. add the assertion as a child of the sampler.

or to update variables that aren't extracted from response text. If a PreProcessor is attached to a Sampler element. A Pre-Processor is most often used to modify the settings of a Sample Request just before it runs. 4. it is suggested that the element is placed only at the start of a Thread Group.9 Execution order 1. Listeners (unless SampleResult is null) Please note that Timers.Test Plan Showing Accessability of Configuration Elements The User Defined Variables Configuration element is different. and the type of test element. If a PostProcessor is attached to a Sampler element. Post-Processors (unless SampleResult is null) 6. Pre. See the scoping rules for more details on when Post-Processors are executed. Assertions (unless SampleResult is null) 7. Logic Controllers and Samplers are processed in the order in which they appear in the tree. then it will execute just prior to that sampler element running. Other test elements are processed according to the scope in which they are found. Sampler 5. [Within a type. For simplicity. 4. no matter where it is placed. It is processed at the start of a test.Figure 1 . often to extract values from it. Configuration elements 2.7 Pre-Processor Elements A Pre-Processor executes some action prior to a Sampler Request being made. See the scoping rules for more details on when Pre-Processors are executed.8 Post-Processor Elements A Post-Processor executes some action after a Sampler Request has been made. 4. Timers 4. Assertions. then it will execute just after that sampler element runs. elements are . A Post-Processor is most often used to process the response data. Pre-Processors 3.and Post-Processors are only processed if there is a sampler to which they apply.

When you create your test plan. Given the following test tree: . Config Elements. For example. samplers). Assertions. in the following test plan: • Controller o Post-Processor 1 o Sampler 1 o Sampler 2 o Timer 1 o Assertion 1 o Pre-Processor 1 o Timer 2 o Post-Processor 2 The order of execution would be: Pre-Processor 1 Timer 1 Timer 2 Sampler 1 Post-Processor 1 Post-Processor 2 Assertion 1 Pre-Processor 1 Timer 1 Timer 2 Sampler 2 Post-Processor 1 Post-Processor 2 Assertion 1 4. you will create an ordered list of sample request (via Samplers) that represent a set of steps to be executed. These requests are often organized within controllers that are also ordered. PreProcessors.10 Scoping Rules The JMeter test tree contains elements that are both hierarchical and ordered.processed in the order in which they appear in the tree]. Post-Procesors. Timers). and some are primarily ordered (controllers. Some elements in the test trees are strictly hierarchical (Listeners.

while Assertion #2 is applied to Requests Two and Three. Four.Example test tree The order of requests will be. this time using Timers: complex example In this example. Three. for instance. then it affects all requests that are descendants of that Controller. the requests are named to reflect the order in which they will be executed. If its parent is a request. If its parent is a Controller. is hierarchical in the test tree. and you can read about these specific controllers in the component reference . then it is applied to that request. . One. Two. Other elements are hierarchical. Some controllers affect the order of their subelements. In the following test tree: Hierarchy example Assertion #1 is applied only to Request One. Another example. An Assertion.

If you imagine each Request being passed up the tree branches. only one Manager is used. Timer #2 will affect all the requests. then the last one takes effect. Assertion #1 will apply only to Request Three.properties (see Gettting Started .see Functions . see Functions and Variables Note that the values defined by the Test Plan and the User Defined Variables configuration element are made available to the whole test plan at startup.but cannot be used for thread-specific values. Once a thread has started.Timer #1 will apply to Requests Two. However. and these can be used later by the same thread. but there is currently no way to specify which is used. These are global to the test plan. The values may be the same for each thread. Cookie Manager and Authorization manager are treated differently from the Configuration Default elements. For example the Regular Expression Extractor Post-Processor will set its variables according to the sample that its thread has read. the settings from the Managers are not merged. Other elements such as the User Parameters Pre-Processor or Regular Expression Extractor Post-Processor may be used to redefine the same variables (or create new ones).11 Properties and Variables JMeter properties are defined in jmeter. and Four (notice how order is irrelevant for hierarchical elements). If a variable is updated by a thread. and are mostly used to define some of the defaults JMeter uses.read a property . the initial set of variables is copied to each thread. or they may be different. If more than one Manager is in the scope of a Sampler. If the same variable is defined by multiple UDV elements.should that be needed. For example the property remote_hosts defines the servers that JMeter will try to run remotely. and each time collecting all the configuration elements of that parent. only the thread copy of the variable is changed. JMeter variables are local to each thread. The Configuration elements Header Manager.Configuring JMeter for more details). Both variables and properties are case- . These redefinitions only apply to the current thread. Hopefully these examples make it clear how configuration (hierarchical) elements are applied. so can be used to pass information between threads . 4. Properties are global to jmeter. Three. then to its parent's parent. The settings from the Configuration Default elements are merged into a set of values that the Sampler has access to. For details of how to reference variables and functions. then you will see how it works. Properties can be referenced in test plans . to its parent. etc. The setProperty function can be used to define a JMeter property.

Building a Web Test Plan In this section.. HTTP Request Defaults . you might define the following on the Test Plan: HOST THREADS LOOPS www. you will use the following elements: Thread Group . and Graph Results . you will learn how to create a basic Test Plan to test a Web site. For a more advanced Test Plan. the total number of requests is (5 users) x (2 requests) x (repeat 2 times) = 20 HTTP requests. the name of a host. but becomes tedious when testing lots of different combinations. You may wish to use a different naming convention for these. If you later want to change the host. -Jhost=www3.20)} You can then change some or all of the values on the command-line as follows: jmeter .12 Using Variables to parameterise tests Variables don't have to vary .org -Jloops=13 5.com)} ${__P(threads.10)} ${__P(loops. You will create five users that send requests to two pages on the Jakarta Web site.example. will not change value. Also consider which items need to be local to a thread . Decide on some variable names for these . Also. you will tell the users to run their tests twice. Or for items which are constant during a run.for example counters or values extracted with the Regular Expression Post-Processor. 4. 5. and if left alone. but which may vary between runs.sensitive.1 Adding Users .they can be defined once. When deciding how to structure a Test Plan. So you can use them as short-hand for expressions that appear frequently in a test plan. see Building an Advanced Web Test Plan . make a note of which items are constant for the run.com 10 20 You can refer to these in the test plan as ${HOST} ${THREADS} etc.perhaps use a naming convention such as prefixing them with C_ or K_ or using uppercase only to distinguish them from variables that need to change during the test. This works fine for small numbers of tests. One solution is to use a property to define the value of the variables.. but which may change between runs. For example.www. for example: HOST THREADS LOOPS ${__P(host. or the number of threads in a thread group.example. To construct the Test Plan. HTTP Request . So. just change the value of the HOST variable. For example.example.

the Ramp-Up Period. select the Forever checkbox. leave the the default value of 1 seconds. Next. and the how many requests they should send. If you enter a loop count value of 1. This property tells JMeter how many times to repeat your test. clicking your right mouse button to get the Add menu. In the name field.1 below) Figure 5.The first step you want to do with every JMeter Test Plan is to add a Thread Group element. you need to modify the default properties. To have JMeter repeatedly run your Test Plan. Finally enter a value of 2 in the Loop Count field. You should now see the Thread Group Control Panel in the right section of the JMeter window (see Figure 5. increase the number of users (called threads) to 5. Thread Group with Default Values Start by providing a more descriptive name for our Thread Group. If you set the value to 0. if you enter a RampUp Period of 5 seconds. You should now see the Thread Group element under Test Plan. The Thread Group tells JMeter the number of users you want to simulate. For example. JMeter will finish starting all of your users by the end of the 5 seconds. In the next field. Next. and then select Add --> ThreadGroup. This property tells JMeter how long to delay between starting each user. So. then "expand" the Test Plan tree by clicking on the Test Plan element. then JMeter will run your test only once. then the delay between starting users would be 1 second (5 users / 5 seconds = 1 user per second). If you do not see the element. if you have not already selected it.1. how often the users should send requests. Select the Thread Group element in the tree. In most applications. Go ahead and add the ThreadGroup element by first selecting the Test Plan. you have to manually . enter Jakarta Users. if we have 5 users and a 5 second Ramp-Up Period. then JMeter will immediately start all of your users.

when selecting another tree element). and then select Add --> Config Element --> HTTP Request Defaults. Jakarta Users Thread Group 5. you will add HTTP Request elements which use some of the default settings you specified here. the Control Panel automatically accepts your changes as you make them.2 for the completed Jakarta Users Thread Group. the tree will be updated with the new text after you leave the Control Panel (for example. in section 5. Figure 5.accept changes you make in a Control Panel. in JMeter.3. If you change the name of an element.2. However. Click your right mouse button to get the Add menu. And then. select this new element to view its Control Panel (see Figure 5. In this section. you will specify the default settings for your HTTP requests. See Figure 5. Then.3). it is time to define the tasks that they will be performing. Begin by selecting the Jakarta Users (Thread Group) element. .2 Adding Default HTTP Request Properties Now that we have defined our users.

In this example.apache. the HTTP Request Defaults Control Panel has a name field that you can modify. The HTTP Request Defaults element does not tell JMeter to send an HTTP request. It simply defines the default values that the HTTP Request elements use. Skip to the next field.Figure 5. leave this field with the default value. For the Test Plan that you are building. This is the only field that we will specify a default. all HTTP requests will be sent to the same Web server. jakarta.org. HTTP Request Defaults Like most JMeter elements. Enter this domain name into the field.4 for the completed HTTP Request Defaults element . so leave the remaining fields with their default values. See Figure 5.3. which is the Web Server's Server Name/IP.

Then.3 Adding Cookie Support Nearly all web testing should use cookie support. but shared across all HTTP Request objects. The first one is for the Jakarta home page (http://jakarta. we need to make two HTTP requests. To add cookie support. HTTP Defaults for our Test Plan 5. To add the HTTP Cookie Manager . 5. select the HTTP Request element in the tree and edit the following properties (see Figure 5. simply select the Thread Group . either from the Edit Menu.apache. Set the Path field to "/". and the second one is for the Project Guidelines page (http://jakarta. and choose Add --> Config Element --> HTTP Cookie Manager. Start by adding the first HTTP Request to the Jakarta Users element (Add --> Sampler --> HTTP Request).org/site/guidelines. JMeter sends requests in the order that they appear in the tree.html).5): 1. This will ensure that each thread gets its own cookies. Remember that you do not have to set the Server Name field because you already specified this value in the HTTP Request Defaults element. . 2. or from the rightclick pop-up menu.apache.4 Adding HTTP Requests In our Test Plan. Change the Name field to "Home Page". simply add an HTTP Cookie Manager to each Thread Group in your test plan.4. unless your application specifically doesn't use cookies.org/).Figure 5.

5. add the second HTTP Request and edit the following properties (see Figure 5.6: 1.html". HTTP Request for Jakarta Home Page Next. . Change the Name field to "Project Guidelines". 2. Set the Path field to "/site/guidelines.Figure 5.

or select the Browse button and browse to a directory and then enter a filename. . This element is responsible for storing all of the results of your HTTP requests in a file and presenting a visual model of the data.5 Adding a Listener to View Store the Test Results The final element you need to add to your Test Plan is a Listener . You can either type it into the filename field. HTTP Request for Jakarta Project Guidelines Page 5. Select the Jakarta Users element and add a Graph Results listener (Add --> Listener --> Graph Results). Next. you need to specify a directory and filename of the output file.Figure 5.6.

Click the Add button twice and enter the username and password details. add an HTTP Request. but some web-sites require you to login before permitting you to perform certain actions. These can be found out by inspecting the code of the login page. The button generates a POST request. you can use the JMeter Proxy Recorder to record the login sequence. and set the method to POST. In a web-browser. You'll need to know the names of the fields used by the form.7. passing the values of the form items as parameters.Figure 5. To do this in JMeter. Sometimes the login form contains additional hidden fields.] Set the path to the target of the submit button. and the target page. the login will be shown as a form for the user name and password. Graph Results Listener 5. These will need to be added as well.6 Logging in to a web-site It's not the case here. . and a button to submit the form. [If this is difficult to do.

Simply enter the name of your session ID parameter into the modifier. then you'll need to do a bit of extra work to test your site. and it will find it and add it to each request. see Building a Web Test Plan .Figure 5. you will learn how to create advanced Test Plans to test a Web site.8. Use the appropriate HTTP URL Re-writing Modifier to accomplish this. For an example of a basic Test Plan. If "Cache Session Id?" is checked. JMeter needs to parse the HTML received from the server and retrieve the unique session ID. then the last found session id will be . Building an Advanced Web Test Plan In this section. 6. To respond correctly to URL rewriting.1 Handling User Sessions With URL Rewriting If your web application uses URL rewriting rather than cookies to save session information. If the request already has a value. Sample HTTP login request 6. it will be replaced.

thus assuring that it will only affect requests under that SimpleController. Figure 1 . The HTTP Header Manager . 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.2 Using a Header Manager The HTTP Header Manager lets you customize what information JMeter sends in the HTTP request header."). like the HTTP Cookie Manager . This header includes properties like "User-Agent".Test Tree In Figure 2. In Figure 1 is shown a test plan using URL rewriting. "Pragma". "Referer". etc. . rather than a request parameter Figure 2 . Note that the URL Re-writing modifier is added to the SimpleController. and will be used if the previous HTTP sample does not contain a session id.Request parameters 6. There is also a checkbox for indicating that the session ID should be part of the path (separated by a ". URL Rewriting Example Download this example . unless for some reason you wish to specify different headers for the different HTTP Request objects in your test. should probably be added at the Thread Group level.saved.

its containing . how often the users should send requests.1 below) Figure 7. Also. and then select Add --> ThreadGroup. Go ahead and add the ThreadGroup element by first selecting the Test Plan. . the total number of requests is (10 users) x (2 requests) x (repeat 3 times) = 60 JDBC requests. you will use the following elements: Thread Group . This example uses the MySQL database driver. then "expand" the Test Plan tree by clicking on the Test Plan element.7. and the how many requests they should send.1. you will tell the users to run their tests three times. enter JDBC Users. So.jar file must be copied to the JMeter lib directory (see JMeter's Classpath for more details).1 Adding Users The first step you want to do with every JMeter Test Plan is to add a Thread Group element. Next. In the name field. If you do not see the element. You should now see the Thread Group element under Test Plan. Building a Database Test Plan In this section. you need to modify the default properties. 7. The Thread Group tells JMeter the number of users you want to simulate. Select the Thread Group element in the tree. To construct the Test Plan. Thread Group with Default Values Start by providing a more descriptive name for our Thread Group. To use this driver. You will create ten users that send five SQL requests to the database server. You should now see the Thread Group Control Panel in the right section of the JMeter window (see Figure 7. JDBC Request . Graph Results . clicking your right mouse button to get the Add menu. you will learn how to create a basic Test Plan to test a database server. if you have not already selected it.

select the Forever checkbox. the tree will be updated with the new text after you leave the Control Panel (for example. For example. you have to manually accept changes you make in a Control Panel. then the delay between starting users would be 1 second (5 users / 5 seconds = 1 user per second). To have JMeter repeatedly run your Test Plan. Figure 7. In the next field. increase the number of users to 10. the database is 'mydb' and the table name is 'Stocks'. See Figure 7. then JMeter will immediately start all of your users. In the example shown here. leave the the default value of 0 seconds. JMeter will finish starting all of your users by the end of the 5 seconds. So. JDBC Users Thread Group . the Ramp-Up Period. In most applications. in JMeter. if we have 5 users and a 5 second Ramp-Up Period. Next. enter a value of 3 in the Loop Count field.2 for the completed JDBC Users Thread Group.2. This property tells JMeter how long to delay between starting each user. database table. However. when selecting another tree element). Finally. if you enter a RampUp Period of 5 seconds.You will need a valid database. If you set the value to 0. the Control Panel automatically accepts your changes as you make them. If you change the name of an element. and user-level access to that table. This property tells JMeter how many times to repeat your test.

It is used by the JDBC Sampler to identify the configuration to be used. This needs to uniquely identify the configuration. In this section. Click your right mouse button to get the Add menu. and then select Add --> Config Element --> JDBC Connection Configuration.jdbc. Every JDBC Request must refer to a JDBC Configuration pool. • Database URL: jdbc:mysql://localhost:3306/test • JDBC Driver class: com. you will specify the JDBC requests to perform. Set up the following fields (these assume we will be using a local MySQL database called test): Variable name bound to pool.2 Adding JDBC Requests Now that we have defined our users.7. .3). but they must have unique names. More than one JDBC Request can refer to the same pool. The pool is referred to in JDBC Requests in the 'Variable Name' field. it is time to define the tasks that they will be performing. JMeter creates a database connection pool with the configuration settings as specified in the Control Panel. Several different JDBC Configuration elements can be used. Begin by selecting the JDBC Users element.mysql. Then.Driver • Username: guest • Password: password for guest • The other fields on the screen can be left as the defaults. select this new element to view its Control Panel (see Figure 7.

Then. select this new element to view its Control Panel (see Figure 7.4). The first one is for Eastman Kodak stock. Click your right mouse button to get the Add menu. JDBC Request In our Test Plan. JDBC Configuration Selecting the JDBC Users element again. and then select Add --> Sampler --> JDBC Request.Figure 7. Figure 7. we will make two JDBC requests. .4.3.

add the second JDBC Request and edit the following properties (see Figure 7.6): • • Change the Name to "Pfizer". Figure 7.5): • • • Change the Name to "Kodak". Enter the SQL Query String field.and the second is Pfizer stock (obviously you should change these to examples appropriate for your particular database). Start by editing the following properties (see Figure 7. . JDBC Request for Eastman Kodak stock Next. These are illustrated below. JMeter sends requests in the order that you add them to the tree.5. Enter the Pool Name: MySQL (same as in the configuration element) Enter the SQL Query String field.

Figure 7. JDBC Request for Pfizer stock 7. Graph results Listener .7. Select the JDBC Users element and add a Graph Results listener (Add --> Listener --> Graph Results). This element is responsible for storing all of the results of your JDBC requests in a file and presenting a visual model of the data.6.3 Adding a Listener to View/Store the Test Results The final element you need to add to your Test Plan is a Listener . Figure 7.

how often the users should send requests. The Thread Group tells JMeter the number of users you want to simulate. You should now see the Thread Group Control Panel in the right section of the JMeter window (see Figure 8. Next. www. FTP Request .1. In the name field. and Spline Visualizer . Please be considerate when running this example. the total number of requests is (4 users) x (2 requests) x (repeat 2 times) = 16 FTP requests. you will use the following elements: Thread Group . .oro. if you have not already selected it. This example uses the O'Reilly FTP site. Building an FTP Test Plan In this section.1 below) Figure 8. Thread Group with Default Values Start by providing a more descriptive name for our Thread Group.1 Adding Users The first step you want to do with every JMeter Test Plan is to add a Thread Group element. enter O'Reilly Users. FTP Request Defaults .8.com. then "expand" the Test Plan tree by clicking on the Test Plan element. 8. So. Go ahead and add the ThreadGroup element by first selecting the Test Plan. Select the Thread Group element in the tree. If you do not see the element. you will learn how to create a basic Test Plan to test an FTP site. You should now see the Thread Group element under Test Plan. and then select Add --> ThreadGroup. and the how many requests they should send. Also. you need to modify the default properties. You will create four users that send requests for two files on the O'Reilly FTP site. To construct the Test Plan. and (if possible) consider running against another FTP site. you will tell the users to run their tests twice. clicking your right mouse button to get the Add menu.

To have JMeter repeatedly run your Test Plan. If you change the name of an element. the Ramp-Up Period. increase the number of users to 4. See Figure 8.2. select the Forever checkbox.2 for the completed O'Reilly Users Thread Group. when selecting another tree element). Finally. For example. This property tells JMeter how long to delay between starting each user. leave the the default value of 0 seconds. enter a value of 2 in the Loop Count field. the Control Panel automatically accepts your changes as you make them. in JMeter. So. then JMeter will immediately start all of your users. you have to manually accept changes you make in a Control Panel. the tree will be updated with the new text after you leave the Control Panel (for example. Figure 8. then the delay between starting users would be 1 second (5 users / 5 seconds = 1 user per second). In most applications. In the next field. O'Reilly Users Thread Group . If you set the value to 0. if you enter a RampUp Period of 5 seconds. However. This property tells JMeter how many times to repeat your test. if we have 5 users and a 5 second Ramp-Up Period. JMeter will finish starting all of your users by the end of the 5 seconds.Next.

Click your right mouse button to get the Add menu. Enter this domain name into the field. It simply defines the default values that the FTP Request elements use. Figure 8. it is time define the tasks that they will be performing. all FTP requests will be sent to the same FTP server. you will specify the default settings for your FTP requests. FTP Request Defaults Like most JMeter elements. And then. select this new element to view its Control Panel (see Figure 8. which is the FTP Server's Server Name/IP. For the Test Plan that you are building. See Figure 8.8. ftp. Begin by selecting the O'Reilly Users element. you will add FTP Request elements which use some of the default settings you specified here. leave this field with the default value. In this section. Then.2 Adding Default FTP Request Properties Now that we have defined our users. the FTP Request Defaults Control Panel has a name field that you can modify. In this example.3). The FTP Request Defaults element does not tell JMeter to send an FTP request. and then select Add --> Config Element --> FTP Request Defaults. in section 8.4 for the completed FTP Request Defaults element .3.3. so leave the remaining fields with their default values.com. Skip to the next field.oro. This is the only field that we will specify a default.

txt). Change the File to Retrieve From Server field to "pub/msql/java/README".com/pub/msql/java/tutorial. 3. and the second is for the tutorial file (ftp://ftp.oro. Change the Name to "README". 2. FTP Defaults for our Test Plan 8. Then.oro. JMeter sends requests in the order that they appear in the tree.Figure 8.4. Change the Password field to "anonymous". Change the Username field to "anonymous". .3 Adding FTP Requests In our Test Plan. The first one is for the O'Reilly mSQL Java README file (ftp://ftp. 4.com/pub/msql/java/README).5): 1. You do not have to set the Server Name field because you already specified this value in the FTP Request Defaults element. we need to make two FTP requests. Start by adding the first FTP Request to the O'Reilly Users element (Add --> Sampler --> FTP Request). select the FTP Request element in the tree and edit the following properties (see Figure 8.

Change the Username field to "anonymous".4 Adding a Listener to View/Store the Test Results The final element you need to add to your Test Plan is a Listener . Change the File to Retrieve From Server field to "pub/msql/java/tutorial. add the second FTP Request and edit the following properties (see Figure 8.6. FTP Request for O'Reilly mSQL Java README file Next. 4.5.txt". 2. 3.Figure 8. Figure 8. This element is responsible for storing all of the results of your FTP requests in a file and presenting a visual model of the data. FTP Request for O'Reilly mSQL Java tutorial file 8. Change the Password field to "anonymous".6: 1. Select the O'Reilly Users element and add a Spline Visualizer listener (Add --> Listener --> . Change the Name to "tutorial".

This example assumes that the LDAP Server is installed in your Local machine. LDAP Request . you will tell the users to run their tests twice. clicking your right mouse button to get the Add menu. To construct the Test Plan. So. how often the users should send requests. Building an LDAP Test Plan In this section. You will create four users that send requests for four tests on the LDAP server. then "expand" the Test Plan tree by clicking on the Test Plan element. LDAP Request Defaults .Spline Visualizer). Go ahead and add the ThreadGroup element by first selecting the Test Plan.Also. The Thread Group tells JMeter the number of users you want to simulate. and then select Add-->ThreadGroup. If you do not see the element. and the how many requests they should send. and View Results in Table .7. You should now see the Thread Group element under Test Plan. Spline Visualizer Listener 9a. 9a. the total number of requests is (4 users) x (4 requests) x repeat 2 times) = 32 LDAP requests. you will learn how to create a basic Test Plan to test an LDAP server. Figure 8.1 Adding Users The first step you want to do with every JMeter Test Plan is to add a Thread Group element. you will use the following elements: Thread Group . .

Figure 9a. the Login Config Element Control Panel has a name field that you can modify. and then select Add --> Config Element --> Login Config Element. select this new element to view its Control Panel. Thread Group with Default Values 9a. .1. Click your right mouse button to get the Add menu. In this example. Then. The password field to "your Server Passowrd" These values are default for the LDAP Requests.2 Adding Login Config Element Begin by selecting the Siptech Users element. Like most JMeter elements. leave this field with the default value.2 Login Config Element for our Test Plan Enter Username field to "your Server Username".Figure 9a.

Click your right mouse button to get the Add menu. select this new element to view its Control Panel. the LDAP Request Defaults Control Panel has a name field that you can modify.3 Adding LDAP Request Defaults Begin by selecting the Siptech Users element. Then. In this example. Start by adding the first LDAP Request to the Siptech Users element (Add --> Sampler --> LDAP Request). 3. select the LDAP Request element in the tree and edit the following properties . 1. 9a. Enter LDAP Server's Servername field to "localhost".3 LDAP Defaults for our Test Plan Enter DN field to "your Server Root Dn". Then. Inbuilt Add Test Inbuilt Modify Test Inbuilt Delete Test Inbuilt Search Test JMeter sends requests in the order that you add them to the tree. Like most JMeter elements. 2. Figure 9a. The port to 389.9a.4 Adding LDAP Requests In our Test Plan. leave this field with the default value. we need to make four LDAP requests. These values are default for the LDAP Requests. and then select Add --> Config Element -->LDAP Request Defaults. 4.

Select the Modify test Radio button Figure 9a.2 LDAP Request for Inbuilt Modify test . Username. Change the Name to "Inbuilt-Add Test". Next.1. Change the Name to "Inbuilt-Modify Test".1 LDAP Request for Inbuilt Add test You do not have to set the Server Name field.4. Password and DN because you already specified this value in the Login Config Element and LDAP Request Defaults.4. add the second LDAP Request and edit the following properties 1. Select the Add test Radio button Figure 9a. 2. port field. 2.

4 LDAP Request for Inbuilt Search test 9a. Change the Name to "Inbuilt-Delete Test". 2.4.5 Adding a Listener to View/Store the Test Results The final element you need to add to your Test Plan is a Listener.Select the Siptech Users element and add a View Results in Table (Add --> Listener -->View Results in Table) . Change the Name to "Inbuilt-Search Test". This element is responsible for storing all of the results of your LDAP requests in a file and presenting a visual model of the data.3 LDAP Request for Inbuilt Delete test 1. Select the Delete test Radio button Figure 9a. 2. Select the Search test Radio button Figure 9a.1.4.

you will use the following elements: Thread Group . you need to use 4 backslashes. Building an Extended LDAP Test Plan In this section. you will tell the users to run their tests twice.txt . in that case (eg. So.5 View result in Table Listener 9b. and Adding a Listener to View/Store the Test Results This example assumes that the LDAP Server is installed in your Local machine. Take care when using LDAP special characters in the distinghuished name. I build a small LDAP tutorial which shortly explains the several LDAP operations that can be used in building a complex testplan. Adding LDAP Requests . You will create four users that send requests for four tests on the LDAP server. the total number of requests is (4 users) x (4 requests) x repeat 2 times) = 32 LDAP requests. For the less experienced LDAP users. Adding LDAP Extended Request Defaults . you want to use a + sign in a distinghuished name) you need to escape the character by adding an "\" sign before that character. As the Extended LDAP Sampler is highly configurable. You can however tune it exactly up to your needs. you will learn how to create a basic Test Plan to test an LDAP server.Figure 9a. To construct the Test Plan.txt to add an entry with a name like cn=c:\log.Also. this also means that it takes some time to build a correct testplan. examples: cn=dolf\+smits to add/search an entry with the name like cn=dolf+smits cn=dolf \\ smits to search an entry with the name cn=dolf \ smits cn=c:\\\\log. extra exeption: if you want to add a \ character in a distinguished name (in an add or rename operation).

and then select Add --> Config Element -->LDAP Extended Request Defaults. then "expand" the Test Plan tree by clicking on the Test Plan element.1. Go ahead and add the ThreadGroup element by first selecting the Test Plan. Figure 9b.2 Adding LDAP Extended Request Defaults Begin by selecting the Thread Group element. Like most JMeter elements. You should now see the Thread Group element under Test Plan. Then. the LDAP Extended Request Defaults Control Panel has a name field that you can modify. how often the users should send requests. If you do not see the element. and the how many requests they should send. and then select Add-->ThreadGroup.9b. Thread Group with Default Values 9b. Click your right mouse button to get the Add menu. clicking your right mouse button to get the Add menu. The Thread Group tells JMeter the number of users you want to simulate.1 Adding Users The first step you want to do with every JMeter Test Plan is to add a Thread Group element. . In this example. leave this field with the default value. select this new element to view its Control Panel.

For each requst.1 Adding a Thread bind Request 1. 6. 3. you can override the defaults by filling in the values in the LDAP extended request sampler. when a default is filled in.3. 5. 1. we want to use all 8 LDAP requests. Then. Select the "Thread bind" button. Adding a requests always start by: Adding the LDAP Extended Request to the Thread Group element (Add --> Sampler --> LDAP Ext Request). Thread bind Search Test Compare Test Single bind/unbind Test Add Test Modify Test Delete Test Rename entry (moddn) Thread unbind JMeter sends requests in the order that you add them to the tree. some default values can be filled in. 4. select the LDAP Ext Request element in the tree and edit the following properties. 8. 2. 2. this is used for the LDAP extended requests. 9b. the test will fail in an unpredictable way! 9b. 9.Figure 9b. When no valueis entered which is necesarry for a test.2 LDAP Defaults for our Test Plan For each of the different operations.3 Adding LDAP Requests In our Test Plan. In All cases. enter the hostname value from the LDAP server in the Servername field . 7.

6. this files is important if you want to use a "base-entry" or "one-level" search (see below) 3. use the common denominator (dc=siemens.1. Enter the portnumber from the LDAP server (389) in the port field 4.3. Figure 9b. When this field is kept empty.2 Adding a search Request 1. Enter the value 0 . dc=siemens. (optional) enter the baseDN in the DN field. (optional) enter the scope in the scope field. Enter the searchfilter. Select the "Search Test" button. When left empty. but for now. relative to the basedn. any decent LDAP serach filter will do. dc=com. You cannot search or rename anymore in the subtree ou=users. take care that this must be the uppermost shared level for all your request. (Optional) enter the searchbase under which you want to perform the search. 5. Base level. (Optional) enter the distinghuised name from the user you want to use for authentication. (optional) Enter the password for the user you want to authenticate with. you can use this value in the basedn. an anonymous bind will be established. use something simple.dc=com) as the baseDN. deletes etc. an empty password will also lead to an anonymous bind.dc=com! If you need to search or rename objects in both subtrees. this baseDN will be used as thestarting point for searches. 2. used in the thread bind request. it has three options: 1.dc=siemens. add. eg When all information is stored under ou=people.3. Thread Bind example 9b. like cn=john doe 4. the basedn is used as a search base.3.

Put in the attributes. 9. you may have to wait for ages for the completion of the search request. It will return only the requested attributes 8. 2. it will add these to the requested attributes. This can be used to limit the size of the answer. Enter the value 2 Searches for object at any point below the given basedn 5. (Optional) Return object. . false says it will not. Subtree. from a very fast server. possible values "true" and "false". One level. the SERVER can use for performing the search. Put in one empty value (""). but this parameter will not influence this. so in reality it returns no attributes 3. especially when an onject has very large attributes (like jpegPhoto). it will request a non-existent attributes. True will mean it will follow references. (Optional) Sizelimit. 2.only the given searchbase is used. 6. (Optional) Attributes you want in the search answer. as specified above. false will mean no java-object attributes will be returned. specifies the maximun number of returned entries. seperated by a semi-colon. possible values are "true" and "false". psecifies the maximum number of miliseconds. (Optional) Dereference aliases. it is NOT the maximun time the application will wait! When a very large returnset is returned. Leave empty (the default setting must also be empty) This will return all attributes. (optional) Timelimit. over a very slow line. True will return all java-object attributes. Enter the value 1 Only search in one level below given searchbase is used 3. There are three possibilities: 1. only for checking attributes or existence. 7.

eg "mail=John. relative to the basedn.3.ou=people" 3.3. Select the "Compare" button. enter the entryname form the object on which you want the compare operation to work. Compare example .3. this must be in the form "attribute=value".doe@siemens.Figure 9b. 2.com" Figure 9b. Enter the compare filter. eg "cn=john doe.2. search request example 9b.3 Adding a Compare Request 1.3.

2. Select the "Add" button. 3. Select the "Single bind/unbind" button.4 Adding a Single bind/unbind 1. fill in the attribute and value. and a different value. relative to the basedn. Take care: This single bind/unbind is in reality two seperate operations but cannot easily be split! Figure 9b. see picture! (sometimes the server adds the attribute "objectClass=top". .3. Enter the distinghuised name for the object to add.ou=people. 4. 3. just add a new line.dc=siemens. an empty password will also lead to an anonymous bind. this might give a problem. Enter the FULL distinghuised name from the user you want to use for authentication.4. eg. an anonymous bind will be established. add the attribute again. Enter the password for the user you want to authenticate with. 2. Add a line in the "add test" table. When you need the same attribute more than once. cn=john doe.5 Adding an Add Request 1. Single bind/unbind example 9b.9b.3.dc=com When this field is kept empty.3. All necessary attributes and values must be specified to pass the test.

When the attribute is not existing.5.6 Adding a Modify Request 1. with the "add" button.Figure 9b. 3. when it is existing. Select the "Modify test" button. Add a line in the "modify test" table. and the opcode.3. the new value is added. (optional) a value. but single valued.3. relative to the basedn. 2. Add request example 9b. it will be created and the value added . add this will mean that the attribute value (not optional in this case) willbe added to the attribute. replace This will overwrite the attribute with the given new value (not optional here) When the attribute is not existing. it will fail. The meaning of this opcode: 1. 4. You need to enter the attribute you want to modify. it will be created and the value added When it is existing. Enter the distinghuised name for the object to modify. 2. and defined multi-valued.

When one modification fails.3. relative to the baseDN. delete When no value is given. you need to enter "cn=john doe. the test will fail (Optional) Add more modifications in the "modify test" table. . all values will be removed When a value is given. that is. in the DeleteField. Select the "Delete" button. Figure 9b.dc=siemens.dc=com". NO modifications at all will be made and the entry will remain unchanged. 3.3.ou=people" in the Delete-field.7 Adding a Delete Request 1. All modifications which are specified must succeed. and you set the baseDN to "dc=siemens.6. to let the modification test pass. when the given value is not existing. the new value is added. if you want to remove "cn=john doe. enter the name of the entry.ou=people.When it is existing. old values are removed. Modify example 9b.dc=com". only that value will be removed 5. 2.

Delete example 9b. eg you change from cn=john doe. you need to enter "cn=john doe.ou=users.7. to ou=oldusers. it will move the entry.3. relative to the baseDN. in the "old entry name-Field".ou=retired. You can also move a complete subtree (If your LDAP server supports this!!!!). in the "new distinghuised name-Field".ou=people" in the old entry name-field. Select the "Rename Entry" button.Figure 9b. 2.dc=com". it will simply rename the entry when you also add a differten subtree.ou=people to cn=john doe.dc=com". whne you only change the RDN. relative to the baseDN.ou=people. plus all retired people in the subtree to the new place in the tree. and you set the baseDN to "dc=siemens. 3.dc=siemens.3. enter the new name of the entry. enter the name of the entry. eg ou=people.8 Adding a Rename Request (moddn) 1. . that is. if you want to rename "cn=john doe. this will move the complete subtee.ou=users.

3.8.4 Adding a Listener to View/Store the Test Results The final element you need to add to your Test Plan is a Listener. The information which is needed is already known by the system Figure 9b. This element is responsible for storing all of the results of your LDAP requests in a file and presenting a visual model of the data.3. This will be enough as it just closes the current connection.9.9 Adding an unbind Request 1. Rename example 9b.Figure 9b.3. Unbind example 9b. Select the "Thread unbind" button.Select the Thread group element and add a View Results Tree (Add --> Listener -->View Results Tree) .

Also. in practice no relevant information is contained here. The response data contains the full details of the sent request. the sampler result. the total number of requests is (5 users) x (1 requests) x (repeat 2 times) = 10 HTTP requests. View result Tree Listener In this listener you have three tabs to view. the returncode and return message 2. the request and the response data. Building a WebService Test Plan In this section.Figure 9b. and Graph Results . The request gives a short description of the request that was made. The sampler result just contains the response time. WebService(SOAP) Request (Beta Code) . 3. you will learn how to create a Test Plan to test a WebService. So. 10. you will use the following elements: Thread Group .4. . 1. you will tell the users to run their tests twice. The full description can be found here. this is given in a (self defined) xmlstyle. as well the full details of the received answer. You will create five users that send requests to One page. To construct the Test Plan.

which requires activation. In particular. increase the number of users (called threads) to 10. how often the users should send requests.jar and mail. then "expand" the Test Plan tree by clicking on the Test Plan element.General notes on the webservices sampler.jar from SUN. The Thread Group tells JMeter the number of users you want to simulate. If you do not see the element.1 below) Figure 10.1. clicking your right mouse button to get the Add menu. You should now see the Thread Group element under Test Plan. If the xml namespace is different. Thread Group with Default Values Start by providing a more descriptive name for our Thread Group. Select the Thread Group element in the tree. double check the SOAP message and make sure the format is correct. and then select Add --> ThreadGroup. Xmethods contains a list of public webservice for those who want to test their test plan. Next. .1 Adding Users The first step you want to do with every JMeter Test Plan is to add a Thread Group element. and the how many requests they should send. Go ahead and add the ThreadGroup element by first selecting the Test Plan. The current implementation uses Apache SOAP driver. JMeter does not include the jar files in the binary distribution. you need to modify the default properties. if you have not already selected it. the webservice will likely return an error. Due to license restrictions. enter Jakarta Users. If the sampler appears to be getting an error from the webservice. make sure the xmlns attributes are exactly the same as the WSDL. In the name field. 10. You should now see the Thread Group Control Panel in the right section of the JMeter window (see Figure 10. Next.

However. select the Forever checkbox. the Control Panel automatically accepts your changes as you make them. when selecting another tree element). then JMeter will immediately start all of your users. clear the checkbox labeled "Forever".2 for the completed Jakarta Users Thread Group. then the delay between starting users would be 1 second (5 users / 5 seconds = 1 user per second). For example. So. if you enter a RampUp Period of 5 seconds.In the next field. See Figure 10. This property tells JMeter how many times to repeat your test.2 Adding WebService Requests In our Test Plan. you have to manually accept changes you make in a Control Panel. the tree will be updated with the new text after you leave the Control Panel (for example. If you don't know how to write a . and enter a value of 2 in the Loop Count field. the Ramp-Up Period. If you enter a loop count value of 0. Finally. To have JMeter repeatedly run your Test Plan. If you change the name of an element. then JMeter will run your test only once. we won't go into the details of writing a webservice. Since you're using the webservice sampler. This property tells JMeter how long to delay between starting each user.NET webservice. JMeter will finish starting all of your users by the end of the 5 seconds. in JMeter. If you set the value to 0. we will use a . if we have 5 users and a 5 second Ramp-Up Period. Jakarta Users Thread Group 10. Figure 10. leave the the default value of 0 seconds.2. In most applications.

google for webservice and familiarize yourself with writing webservices for Java and . Change the Name field to "WebService(SOAP) Request (Beta Code)". JMeter sends requests in the order that they appear in the tree.NET. The topic is too broad to cover in the user manual. Start by adding the sampler WebService(SOAP) Request (Beta Code) to the Jakarta Users element (Add --> Sampler --> WebService(SOAP) Request (Beta Code) ). select the webservice Request element in the tree and edit the following properties (see Figure 10. Please refer to other sources to get a better idea of the differences. It should be noted there is a significant difference between how . Enter the WSDL URL and click "Load WSDL". Then.NET and Java implement webservices.5): 1. 2. .webservice.

.

This behavior may not be what users expect. The sampler will randomly select files from a given folder and use the text for the soap message. At this point.asmx? WSDL. Select the Jakarta Users element and add a Graph Results listener (Add --> Listener --> Graph Results). The Mind Electric Glue. If no host or port are provided and JMeter wasn't started with command line options. the box should be unchecked.3 Adding a Listener to View Store the Test Results The final element you need to add to your Test Plan is a Listener . . no result will be displayed in view result tree or view results in table. the box should be checked. It will automatically use the proxy host and port passed to JMeter from command line. so it is normal to have a blank SOAPAction for all other webservices. the sampler will fail silently.If the WSDL file was loaded correctly. Cassini is meant to be a simple example and isn't a full blown webserver like IIS. If you do not want JMeter to read the response from the SOAP Webservice. If the test plan is a functional test. This element is responsible for storing all of the results of your HTTP requests in a file and presenting a visual model of the data." If the test plan is intended to stress test a webservice.NET uses SOAPAction. Axis. the correct soap action should be entered. When "Read Soap Responses" is unchecked. if you're testing an IIS webservice the URL will look like this: http://localhost/myWebService/Service. it will use the ones provided by the user. If the drop down remains blank. 10. If a sampler has values in the proxy host and port text field. Next. You can either type it into the filename field. URL and SOAP Data should be blank. Assuming the WSDL is valid. Cassini does not close connections correctly. For convienance. there is a third option of using a message folder. and gSoap. Next. which causes JMeter to hang or not get the response contents. select the web method and click "Configure". if those fields in the sampler are left blank. uncheck "Read Soap Responses. Weblogic. For example. An important note on the sampler. Note: If you're using Cassini webserver. the "Web Methods" drop down should be populated. only . or select the Browse button and browse to a directory and then enter a filename. The sampler should populate the "URL" and "SOAPAction" text fields. You can test the WSDL using a browser that reads XML. SOAPAction. The list includes JWSDP. The last step is to paste the SOAP message in the "SOAP/XML-RPC Data" text area. Currently. it does not work correctly and is not a reliable webserver. You can optionally save the soap message to a file and browse to the location. it means there was a problem getting the WSDL. you need to specify a directory and filename of the output file.

and Graph Results .0.1 Adding a Thread Group The first step you want to do with every JMeter Test Plan is to add a Thread Group element. Topic messaging is generally used in cases where a message is published by a producer and consumed by multiple subscribers. from Apache ActiveMQ. The setup of the test is 1 threadgroup with 5 threads sending 4 messages each through a request queue. See Getting Started for details. Graph Results Listener 11. how often the users . 11. In this section. One uses JMS topics and the other uses queues. Building a JMS Point-to-Point Test Plan Make sure the required jar files are in JMeter's lib directory. To construct the Test Plan. General notes on JMS: There are currently two JMS samplers. If they are not. The Thread Group tells JMeter the number of users you want to simulate.7. shutdown JMeter. JMS Point-to-Point . A JMS sampler needs the JMS implementation jar files. for example.Figure 10. See here for the list of jars provided by ActiveMQ 3. Topic messages are commonly known as pub/sub messaging. copy the jar files over and restart JMeter. you will use the following elements: Thread Group . A fixed reply queue will be used for monitoring the reply messages. you will learn how to create a Test Plan to test a JMS Point-to-Point messaging solution.

If you enter a loop count value of 0. You should now see the Thread Group Control Panel in the right section of the JMeter window (see Figure 11. then JMeter will run your test only once. This property tells JMeter how long to delay between starting each user. and then select Add --> ThreadGroup.should send requests. Clear the checkbox labeled "Forever". JMeter will finish starting all of your users by the end of the 5 seconds. In the next field. Next. You should now see the Thread Group element under Test Plan. Thread Group with Default Values Start by providing a more descriptive name for our Thread Group. and enter a value of 4 in the Loop Count field. you have to manually accept changes you make in a Control Panel. Next. This property tells JMeter how many times to repeat your test. clicking your right mouse button to get the Add menu. To have JMeter repeatedly run your Test Plan. In the name field.1 below) Figure 11. if you have not already selected it. Select the Thread Group element in the tree. increase the number of users (called threads) to 5. For example. you need to modify the default properties. . and the how many requests they should send. then JMeter will immediately start all of your users. Go ahead and add the ThreadGroup element by first selecting the Test Plan. then the delay between starting users would be 1 second (5 users / 5 seconds = 1 user per second). the Ramp-Up Period. enter Point-to-Point. If you do not see the element. if we have 5 users and a 5 second Ramp-Up Period.1. then "expand" the Test Plan tree by clicking on the Test Plan element. So. if you enter a Ramp-Up Period of 5 seconds. In most applications. leave set the value to 0 seconds. If you set the value to 0. select the Forever checkbox.

However. Name Value JMS Resources QueueuConnectionFactory ConnectionFactory JNDI Name Request Queue JNDI Name Reply Queue Message Properties Communication Style Q.RPL example.REQ test org. This is equal to the JNDI name defined in the JNDI properties. when selecting another tree element).activemq. This is just the content of the message. the tree will be updated with the new text after you leave the Control Panel (for example. Nothing needed for active mq. This is equal to the JNDI name defined in the JNDI properties.Q. Then. the Control Panel automatically accepts your changes as you make them.3 Adding a Listener to View Store the Test Results .REQ Q.RPL Description This is the default JNDI entry for the connection factory within active mq.B queue.ActiveMQInitialContextFactory The standard InitialContextFactory for Active MQ tcp://localhost:61616 example.Q.2 Adding JMS Point-to-Point Sampler Start by adding the sampler JMS Point-to-Point to the Point-to-Point element (Add --> Sampler --> JMS Point-to-Point). This means that you need at least a service that responds to the requests. This defines a JNDI name Q.B 11.jndi.REQ for the request queue that points to the queue example. select the JMS Point-to-Point sampler element in the tree. in JMeter.0. If you change the name of an element. 11.A This defines the URL of the active mq messaging system. Request Response Content JMS Properties JNDI Properties InitialContextFactory Properties providerURL queue.RPL for the reply queue that points to the queue example. In building the example a configuration will be provided that works with ActiveMQ 3.A This defines a JNDI name Q.

Figure 11. you need to specify a directory and filename of the output file.The final element you need to add to your Test Plan is a Listener . or select the Browse button and browse to a directory and then enter a filename.2. One uses JMS topics and the other uses queues. you will use the following elements: Thread Group . The total messages is (6 threads) x (1 message) x (repeat 10 times) = 60 messages. JMS Publisher . Graph Results Listener 12. You will create five subscribers and one publisher. JMS Subscriber . and Graph Results . In this section. General notes on JMS: There are currently two JMS samplers. You will create 2 thread groups and set each one to 10 iterations. Next. Topic messages are commonly known as pub/sub messaging. Building a JMS Topic Test Plan JMS requires some optional jars to be downloaded. You can either type it into the filename field. Topic messaging is generally used in cases where a message is published by a producer and . Please refer to Getting Started for full details. Select the Thread Group element and add a Graph Results listener (Add --> Listener --> Graph Results). To construct the Test Plan. you will learn how to create a Test Plan to test JMS Providers. This element is responsible for storing all of the results of your JMS requests in a file and presenting a visual model of the data.

In HTTP. from Apache ActiveMQ. You should now see the Thread Group element under Test Plan. A JMS sampler needs the JMS implementation jar files. See here for the list of jars provided by ActiveMQ 3. Go ahead and add the ThreadGroup element by first selecting the Test Plan. then "expand" the Test Plan tree by clicking on the Test Plan element. how often the users should send requests. Next. In the next field. if you have not already selected it. Thread Group with Default Values Start by providing a more descriptive name for our Thread Group. enter Subscribers. and how many requests they should send. So. if we .consumed by multiple subscribers. 12. for example. JMeter will finish starting all of your users by the end of the 5 seconds.1 Adding Users The first step is add a Thread Group element.0. clicking your right mouse button to get the Add menu. the Ramp-Up Period. Messaging systems are quite different from normal HTTP requests. Select the Thread Group element in the tree. You should now see the Thread Group Control Panel in the right section of the JMeter window (see Figure 12.1 below) Figure 12. if you enter a Ramp-Up Period of 5 seconds. This property tells JMeter how long to delay between starting each user. In the name field. If you do not see the element.1. Next. a single user sends a request and gets a response. increase the number of users (called threads) to 5. set the value to 0 seconds. The Thread Group tells JMeter the number of users you want to simulate. you need to modify the default properties. and then select Add --> ThreadGroup. For example. Messaging system can work in sychronous and asynchronous mode. Queue messaging is generally used for transactions where the sender expects a response.

select the JMS Subscriber element in the tree and edit the following properties: 1. Repeat the process and add another thread group. enter "Publisher" in the name field. If you enter a loop count value of 0. JMeter will immediately start all users.have 5 users and a 5 second Ramp-Up Period. For the second thread group. JMeter wouldn't be able to keep up. In most applications. Change the Name field to "sample subscriber" 2. since small messages will arrive very quickly. Enter the name of the message topic 7. Start by adding the sampler JMS Subscriber to the Subscribers element (Add --> Sampler --> JMS Subscriber). shutdown JMeter. Enter the provider URL. If the JMS provider requires authentication. and set the iteration to 10.properties file. while ActiveMQ and MQSeries does not 8. 12. check the box 10. set the number of threads to 1. However. in JMeter. Clear the checkbox labeled "Forever".2 Adding JMS Subscriber and Publisher Make sure the required jar files are in JMeter's lib directory. the sampler will aggregate messages. If you want to read the response. Enter the name of the connection factory. then JMeter will run your test only once. This is the URL for the JNDI server. Please refer to the documentation of the JMS provider for the information 6. If the JMS provider uses the jndi. the Control Panel automatically accepts your changes as you make them. Then. If they are not. If the JMS . if there is one 5. To have JMeter repeatedly run your Test Plan. select the Forever checkbox. Enter 10 in "Number of samples to aggregate". you have to manually accept changes you make in a Control Panel. and enter a value of 10 in the Loop Count field. the tree will be updated with the new text after you leave the Control Panel (for example. For performance reasons. copy the jar files over and restart JMeter. This property tells JMeter how many times to repeat your test. If you set the value to 0. Orion JMS requires authentication. check "required" and enter the username and password. If the sampler didn't aggregate the messages. when selecting another tree element). If you change the name of an element. For example. check the box 3. Enter the name of the InitialContextFactory class 4. 9. then the delay between starting users would be 1 second (5 users / 5 seconds = 1 user per second). There are two client implementations for subscribers.

This is the URL for the JNDI server. If the message is in object format. check "required" and enter the username and password. try the other. 2. Select the appropriate configuration for getting the message to publish. 9. If the sampler didn't aggregate the messages. Enter the name of the InitialContextFactory class. If you want the sampler to randomly select the message. Select the message type. Enter 10 in "Number of samples to aggregate".provider exhibits zombie threads with one client. 4. Enter the provider URL. Please refer to the documentation of the JMS provider for the information 6. Change the Name field to "sample publisher". select the JMS Publisher element in the tree and edit the following properties: 1. If the JMS provider uses the jndi. while ActiveMQ and MQSeries does not 8. For performance reasons. the sampler will aggregate messages. For example. JMeter wouldn't be able to keep up. Enter the name of the message topic 7. if there is one 5.2. Then. place the messages in a directory and select the directory using browse. make sure . JMS Subscriber Next add the sampler JMS Publisher to the Publisher element (Add --> Sampler --> JMS Subscriber). check the box 3. Orion JMS requires authentication. since small messages will arrive very quickly. 10. If the JMS provider requires authentication. Enter the name of the connection factory.properties file. Figure 12.

JMS Publisher 12. Figure 12.3 Adding a Listener to View Store the Test Results The final element you need to add to your Test Plan is a Listener .3. This element is responsible for storing all of the results of your HTTP requests in a file and presenting a visual model of the data.the message is generated correctly. .

Select the Test Plan element and add a Graph Results listener (Add --> Listener --> Graph Results). You can either type it into the filename field. any servlet container that supports JMX (Java Management Extension) can port the status servlet to provide the same information. As a system administration tool. 13. Building a Monitor Test Plan In this section. Graph Results Listener 13.4.1 Adding A Server . Next. you need to specify a directory and filename of the output file. It also makes it easier to see the relationship between server performance and response time on the client side. you will need to change the MBeanServer lookup to retrieve the correct MBeans. Tomcat's status servlet should work with other containers for the memory statistics without any modifications. The monitor was designed to work with the status servlet in Tomcat 5. Figure 12. or select the Browse button and browse to a directory and then enter a filename. Monitors are useful for a stress testing and system management. In theory. you will learn how to create a Test Plan to monitor webservers. the monitor provides additional information about server performance. To get thread information. For those who want to use the monitor with other servlet or EJB containers. Used with stress testing. the monitor provides an easy way to monitor multiple servers from one console.

Thread Group with Default Values Change the loop count to forever (or some large number) so that enough samples are generated. "expand" the Test Plan tree by clicking on the Test Plan element. select the HTTP Request element in the tree and edit the following properties): 1. please refer to tomcat 5 documentation.19 and newer. using multiple threads for a single server is bad and can create significant stress. 13.2 HTTP Auth Manager Add the HTTP Authorization Manager to the Thread Group element (Add --> Config element --> HTTP Authorization Manager). and then select Add --> ThreadGroup. clicking your right mouse button to get the Add menu. You should now see the Thread Group element under Test Plan. Then. As a general rule. since we are using JMeter as a monitor. Important note: the monitor only works with Tomcat5 build 5. Enter the username and password for your webserver. Figure 13. This is very important for those not familiar with server monitors.The first step is to add a Thread Group element. leave the base URL blank enter the username enter the password 13.0. Change the Name field to "Server Status". Always use 1.3 Adding HTTP Request Add the HTTP Request to the Thread Group element (Add --> Sampler --> HTTP Request). The Thread Group tells JMeter the number of threads you want. Go ahead and add the ThreadGroup element by first selecting the Test Plan. Enter the IP address or Hostname . 2. 2.1. If you do not see the element. For instructions on how to setup Tomcat. 1. 3.

13. Next. If you want to save the calculated statistics. In general. which shows a historical view of the server's performance. Check "Use as Monitor" at the bottom of the sampler 13. The first is the "Health". Set the Path field to "/manager/status" if you're using Tomcat. If specified. Give it a value of "true" in lowercase. Enter the port number 4. the Listener will select the results from the first connector in the sample response. 5. There are two tabs in the monitor results listener. enter a filename in the listener.6 Adding Monitor Results Add the Listener by selecting the test plan element (Add --> Listener -.4 Adding Constant Timer Add a timer to this thread group (Add --> Timer --> Constant Timer).3. which displays the status of the last sample the monitor received. the Listener will choose the first connector which matches the prefix. or select the Browse button and browse to a directory and then enter a filename. You can either type it into the filename field. Select the thread group element and add a Simple Data Writer listener (Add --> Listener --> Simple Data Writer). If you want to save both the raw data and statistics. Enter 5000 milliseconds in the "Thread Delay" box. using intervals shorter than 5 seconds will add stress to your server. . make sure you use different filenames. Find out what is an acceptable interval before you deploy the monitor in your production environment. The Connector prefix field can be used to select a different connector.> Monitor Results). By default. you need to specify a directory and filename of the output file. 13. then the first connector is selected. The second tab is "Performance". If no match is found. Add a request parameter named "XML" in uppercase. 6. add a simple data Listener .5 Adding a Listener to Store the Results If you want to save the raw results from the server.

. A container that is more efficient with thread management might not see any performance degradation. or reached the maximum number of threads.A quick note about how health is calculated. once the threads are maxed out. requests are placed in a queue until a thread is available. but the used memory definitely will show an impact. The relative importance of threads vary between containers. Typically. so the current implementation uses 50/50 to be conservative. a server will crash if it runs out of memory. In the case of Tomcat 5.

graphs or simply written to a log file. add graph results.The performance graph shows for different lines. memory and threads. it is a good idea to profile the application with Borland OptimizeIt or JProbe. but it is not graphed. The results can be shown in a tree. In a well tuned environment. To view the response time graphically. Tomcat 5 returns the maximum memory. add either of the Listeners "View Results Tree" or "View Results in table" to a test plan. To view the contents of a response from any given sampler. If the memory line spikes up and down rapidly. 14. On the left is percent and the right is dead/healthy. Introduction to listeners A listener is a component that shows the results of the samples. it could indicate memory thrashing. Any erratic behavior usually indicates poor performance or a bug of some sort. The free memory line shows how much free memory is left in the current allocated block. tables. spline results or . In those situations. What you want to see is a regular pattern for load. Note the graph has captions on both sides of the graph. the server should never reach the maximum memory.

One oddity in this example is that the output_format is set to csv. To change the default format. all information.but make sure they all use the same configuration! 14.saveservice. and code. 1970 UTC). The same filename can be used by multiple samplers . the response time. If you only wish to record certain samples. Different listeners display the response information in different ways. the data type. and a success indicator. and add the Listener to that. the thread name. For maximum information.save. and are also used for the log file specified by the -l command-line flag (commonly used for non-GUI test runs). so the csv tag is a misnomer in this case. message. Or you can use a Simple Controller to group a set of samplers. The properties are used as the initial settings for the Listener Config pop-up. add the Listener as a child of the sampler. the label.distribution graph. If this box is not checked. The corresponding jmeter. The "Configure" button can be used to specify which fields to write to the file. However. choose "xml" as the format and specify "Functional Test Mode" on the Test Plan element. including the full response data will be logged.output_format= The information to be saved is configurable. and whether to write it as CSV or XML. CSV files are much smaller than XML files.properties (or user.1 Default Configuration The default items to be saved can be defined in the jmeter. find the following line in jmeter. The following example indicates how to set properties to get a vertical bar ("|") delimited format that will output results like:. If checked.properties) file. The listeners section of the components page has full descriptions of all the listeners. the default_delimiter was set to be a vertical bar instead of a comma.properties: jmeter. (Think of CSV as meaning character separated values) .properties that need to be set are shown below. they all write the same raw data to the output file if one is specified. timeStamp|time|label|responseCode|threadName|dataType|success| failureMessage 02/06/03 08:21:42|1187|Home|200|Thread Group-1|text|true| 02/06/03 08:21:42|47|Login|200|Thread Group-1|text|false|Test Failed: expected to contain: password etc. so use CSV if you are generating lots of samples. the default saved data includes a time stamp (the number of milliseconds since midnight. January 1. which typically indicates comma-separated values. However.

saveservice.saveservice.saveservice.assertion_results_failure_message=false # #jmeter.save.on_error=false #jmeter.idle_time=false # Timestamp format # legitimate values: none.output_format=xml # true when field should be saved.save.saveservice.save. #jmeter.save.save. Only xml and csv are currently supported.requestHeaders=false #jmeter.save.saveservice.save.saveservice.saveservice.sample_count=false #jmeter.save.saveservice.jmeter.response_data=false # Save ResponseData for failed samples #jmeter.filename=false #jmeter.saveservice.save.save.saveservice.saveservice.responseHeaders=false #jmeter.save.time=true #jmeter.save.save. # legitimate values: xml.latency=true #jmeter.save.saveservice.save.saveservice.saveservice.saveservice.label=true #jmeter.save.data_type=true #jmeter.saveservice.thread_name=true #jmeter.url=false #jmeter.saveservice.save.saveservice.save. # The commented out values are the defaults. csv.save.saveservice.samplerData=false #jmeter.saveservice.response_data.save.response_message=true #jmeter.save.assertions=true #jmeter.saveservice.timestamp_format=ms #jmeter.hostname=false #jmeter.saveservice.save.bytes=true #jmeter. or a format suitable for SimpleDateFormat #jmeter.saveservice.timestamp_format=MM/dd/yy HH:mm:ss # Put the start time stamp in logs instead of the end .saveservice. false otherwise # assertion_results_failure_message only affects CSV output #jmeter.save.thread_counts=false #jmeter.save.save.successful=true #jmeter.saveservice.save.saveservice.save.save.saveservice.encoding=false #jmeter.saveservice.save.save.output_format=csv jmeter. #-------------------------------------------------------------------------# Results file configuration #-------------------------------------------------------------------------# This section helps determine how result data will be saved.assertion_results_failure_message=true jmeter.default_delimiter=| The full set of properties that affect result file output is shown below.saveservice.response_code=true # response_data is not currently supported for CSV output #jmeter.subresults=true #jmeter.saveservice. ms. db.

default_delimiter=.xsl"?> The date format to be used for the timestamp_format is described in SimpleDateFormat . # For TAB. For example: #sample_variables=SESSION_ID. See above for an example. # Use commas to separate the names. . Items with (CSV) after the name only apply to the CSV format. items with (XML) only apply to XML format.xml_pi=<?xml-stylesheet type="text/xsl" href="sample.save. The defaults are defined as described in the Listener Default Configuration section above. and as additional attributes in XML files.1 Sample Variables Versions of JMeter after 2.saveservice.save. # Default: #jmeter.timestamp. Bear in mind that choosing a date format other than "ms" is likely to make it impossible for JMeter to interpret the value when it is read in later for viewing purposes.default_delimiter=\t #jmeter.print_field_names=false # Optional list of JMeter variable names whose values the result data files.saveservice.3. # Versions of JMeter after 2.sampleresult. 14.REFERENCE # N.saveservice. # Optional xml processing instruction for line 2 of the file: #jmeter.1 allow one to use the sample_variables property to define a list of additional JMeter variables which are to be saved with each sample in the JTL files. first.save.3 one can use: #jmeter. all #jmeter.save.3.save.B. CSV format cannot currently be used to save any items that include line-breaks. The values are written to CSV files as additional columns.assertion_results=none # For use with Comma-separated value (CSV) files or other formats # where the fields' values are separated by specified delimiters.saveservice.2 Sample Result Save Configuration Listeners can be configured to save different items to the result log files (JTL) by using the Config popup as shown below. since JMeter 2.start=true # legitimate values: none.1. The current implementation saves the values in # so the names must be valid XML names.2 send the variable to # to ensure that the correct data is available at the are to be saved in XML as attributes.1. 14. all servers client.saveservice.

apart from: . for example: jmeter -n -t testplan. The configuration of this listener is controlled by entries in the file jmeter.jmx -l testplan_01. then the name is processed as a SimpleDateFormat format applied to the current date.3.3 Resource usage Listeners can use a lot of memory if there are a lot of samples. so if you want to keep the log files for each run.tmp' . This file is recreated each time.jmx -l testplan_02.2 non-GUI (batch) test runs When running in non-GUI mode.3. If the filename contains paired single-quotes. Most of the listeners currently keep a copy of every sample they display. This feature can be used to specify different data and log files for each test run.log jmeter -n -t testplan.Configuration dialogue Note that cookies. Versions of JMeter after 2. the -l flag can be used to create a top-level listener for the test run. for example: log_file='jmeter_'yyyyMMddHHmmss'. you will need to rename it using the -j option as above. 14. 14.jtl -j testplan_02. The -j option was added in version 2.1 support variables in the log file name.properties as described in the previous section. This is in addition to any Listeners defined in the test plan.jtl -j testplan_01. This can be used to generate a unique name for each test run.log by default.log Note that JMeter logging messages are written to the file jmeter. method and the query string are saved as part of the "Sampler Data" option.

time to first response encoding SampleCount .number of bytes in the sample grpThreads . The order of appearance of columns is fixed.if any bytes . use the Simple Data Writer. 200.number of active threads in this thread group allThreads . unless multiple samples are aggregated) • Hostname where the sample was generated • IdleTime .e.e.g.g. Only the specified data items are recorded in the file. and is as follows: timeStamp .total number of active threads in all groups URL Filename . OK threadName dataType . 404 responseMessage .true or false failureMessage . samples with the same elapsed time are aggregated.4 CSV Log format The CSV log format depends on which data items are selected in the configuration. • • • Aggregate Report Aggregate Graph Distribution Graph To minimise the amount of memory needed. 14.if Save Response to File was used latency . Less memory is now needed.in milliseconds label .g.1 .sampler label responseCode .number of milliseconds of 'Idle' time (normally 0) • • • • • • • • • • • • • • • • • • Variables. especially if most samples only take a second or two at most. if specified 14. Instead.5 XML Log format 2. unless multiple samples are aggregated) • ErrorCount .in milliseconds since 1/1/1970 elapsed .number of errors (0 or 1. text success . and use the CSV format.e.• • • • • Simple Data Writer BeanShell/BSF Listener Mailer Visualizer Monitor Results Summary Report The following Listeners no longer need to keep copies of every single sample.number of samples (1.

String">HTTP/1.lang. th { font-size: 95%. Content-Type: text/html. td. charset=ISO-8859-1 </responseHeader> <requestHeader class="java.String"></queryString> <url>http://www.lang.lang.String">MyHeader: MyValue</requestHeader> <responseData class="java. } . color: black. with nested samples <httpSample t="1392" lt="351" ts="1144371014619" s="true" lb="HTTP Request" rc="200" rm="OK" tn="Listen 1-1" dt="text" de="iso-8859-1" by="12407"> <httpSample t="170" lt="170" ts="1144371015471" s="true" lb="http://www.String"></cookies> <method class="java.String">GET</method> <queryString class="java.html</responseFile> <cookies class="java.String">HTTP/1. 07 Apr 2006 00:50:13 GMT . 07 Apr 2006 00:50:14 GMT .apache.lang..String">GET</method> <queryString class="java.String"></cookies> <method class="java.1 200 OK Date: Fri.lang.1 200 OK Date: Fri.apache. font-family: Arial.apache.lang.apache..2"> -..The format of the updated XML (2.String">http://www.apache.css</url> </httpSample> <httpSample t="200" lt="180" ts="1144371015641" s="true" lb="http://www.lang.gif" rc="200" rm="OK" tn="Listen 1-1" dt="bin" de="ISO-8859-1" by="5866"> <responseHeader class="java.org/images/asf_logo_wide.String">MyHeader: MyValue</requestHeader> <responseData class="java.String">HTTP/1..lang.String">body.css" rc="200" rm="OK" tn="Listen 1-1" dt="text" de="ISO-8859-1" by="1002"> <responseHeader class="java.HTTP Sample. Helvetica. </responseData> <cookies class="java.. Geneva.lang.lang.lang.lang.String"> . Content-Type: image/gif </responseHeader> <requestHeader class="java.org/style/style.org/style/style.lang.String">MyHeader: MyValue</requestHeader> <responseData class="java. ... Content-Type: text/css </responseHeader> <requestHeader class="java..org/asf.1) is as follows (line breaks will be different): <?xml version="1.String">Mixed1.String"></queryString> <url>http://www. background-color: white. sans-serif.lang.1 200 OK Date: Fri.0" encoding="UTF-8"?> <testResults version="1.lang.lang...gif</responseData> <responseFile class="java. 07 Apr 2006 00:50:14 GMT .org/asf.gif</url> </httpSample> <responseHeader class="java.

not all samplers support this Number of active threads for all thread groups Number of active threads in this group Response Code (e.String">ssssss</samplerData> </sample> </testResults> Note that the sample node name may be either "sample" or "httpSample". &lt. 200) Response Message (e..String"></requestHeader> <responseData class="java./body&gt.html&gt.lang.String">Listen 1-1</responseData> <responseFile class="java.&lt. </responseData> <cookies class="java.g.lang. Format 2./head&gt. &lt. 1970 UTC) . unless multiple samples are aggregated) Hostname where the sample was generated Idle Time = time not spent sampling (milliseconds) (generally 0) Label Latency = time to initial response (milliseconds) .String">Mixed2. 14. . &lt..nonHTTPP Sample <sample t="0" lt="0" ts="1144372616082" s="true" lb="Example Sampler" rc="200" rm="OK" tn="Listen 1-1" dt="text" de="ISO-8859-1" by="10"> <responseHeader class="java.apache.6 XML Log format 2.String"></queryString> <url>http://www.2 The format of the JTL files is identical for 2.1.lang. &lt.body&gt.unknown</responseFile> <samplerData class="java. OK) Success flag (true/false) Sample count (1./html&gt.lang.lang.lang...2 only affects JMX files.String">GET</method> <queryString class="java.2 and 2.lang.lang. 14.head&gt. unless multiple samples are aggregated) Elapsed time (milliseconds) Thread Name timeStamp (milliseconds since midnight Jan 1. &lt.String"></responseHeader> <requestHeader class="java.g.String"></cookies> <method class="java. .7 Sample Attributes The sample attributes have the following meaning: Attribute by de dt ec hn it lb lt na ng rc rm s sc t tn ts Content Bytes Data encoding Data type Error count (0 or 1.org/</url> </httpSample> -.

. If necessary. When reading from CSV results files. The data will be saved to the clipboard. the variables are saved as additional attributes.1) Versions 2. However. Currently. from where it can be pasted into another application.1 allow additional variables to be saved with the test plan.9 Loading (reading) response data To view an existing results file. images cannot be included. The file name can then be included in the sample log output. Versions of JMeter up to 2.3. A file dialog will appear.3.8 Saving response data As shown above. e." button to select a file. the appropriate JMeter properties must be set. the response data can be saved in the XML log file if required. Results can be read from XML or CSV format files. and use the OS Copy short-cut (normally Control+C). In order to interpret a header-less CSV file correctly. the header (if present) is used to determine which fields were saved.10 Saving Listener GUI data JMeter is capable of saving any listener as a PNG file. 14. just create a dummy testplan with the appropriate Listener in it. To do so. Click edit -> Save As Image. Select the desired cells in the table.1. The Listeners which generate output as tables can also be saved using Copy/Paste. See Sample variables (above) for more information. The data will be retrieved from the file if necessary when the sample log file is reloaded. and saves the file name with the sample. The testplan variable name is used as the attribute name.. 14. This has been corrected so that it is always saved as "rc". you can use the File "Browse. but read it back expecting to find "rc". thus allowing files to be merged. and the text has to be encoded so that it is still valid XML. Enter the desired name and save the listener. 14. this can make the file rather large. select the listener in the left panel.1 and 2. Also. either "rc" or "rs" can be read.3. Versions of JMeter after 2. This is no longer done.2 used to clear any current data before loading the new file. If the previous behaviour is required. a .1 of JMeter saved the Response Code as "rs". Another solution is to use the Post-Processor Save_Responses_to_a_file .g. use the menu item Run/Clear (Ctrl+Shift+E) or Run/Clear All (Ctrl+E) before loading the file.varname Value of the named variable (versions of JMeter after 2. This generates a new file for each sample.

each runs the full test plan. One instance of the JMeter GUI client can control any number of remote JMeter instances.spreadsheet or text editor. remote mode does use more resources than running the same number of non-GUI tests independently. However. This offers the following features: Saving of test samples to the local machine Managment of multiple JMeterEngines from a single machine No need to copy the test plan to each server . By running JMeter remotely.Edit -> Save As Image 15. Figure 1 .the client sends it to all the servers • • • Note: The same test plan is run by all the servers. Remote Testing In the event that your JMeter client machine is unable. remote JMeter engines from a single JMeter GUI client. as can the client network connection. The recommended approach is to have one . JMeter does not distribute the load between servers. performance-wise. you can replicate a test across many low-end computers and thus simulate a larger load on the server. Note that while you can execute the JMeterEngine on your application server. and collect all the data from them. to simulate enough users to stress your server. the client JMeter can become overloaded. If many server instances are used. you need to be mindful of the fact that this will be adding processing overhead on the application server and thus your testing results will be somewhat tainted. an option exists to control multiple.

start the JMeter server component on all machines you wish to run on by running the JMETER_HOME/bin/jmeter-server (unix) or JMETER_HOME/bin/jmeter-server. jmeter -Rhost1. then the server will exit after it runs a single test. the JMeter server application starts the RMI registry itself.bat (windows) script.properties files on each server.3.2 will check for the JMeter property server. Note that there can only be one JMeter server on each node unless different RMI ports are used.1. note that these are not sent across by the client so make sure that these are available in the appropriate directory on each server.1. If the test uses any data files.g.127. RMI uses a dynamic port for the JMeter server engine.properties or system. Note that you can use the -R command line option instead to specify the remote host(s) to use. If necessary you can define different values for properties by editting the user.0. If this is non-zero.or more machines on the same Ethernet segment as your application server that you configure to run the JMeter Engine.create=false on the server host systems.g.properties. find the property named. it will be used as the local port number for the server engine.rmi. there is no need to start RMI registry separately. so versions of JMeter after 2. This can cause problems for firewalls. In /bin/jmeter. also use the same version of Java on all systems.but is best avoided. connecting to a different remote server). This will minimize the impact of the network on the test results without impacting the performance of the application serer itself.localport . if each server must use unique ids. Step 0: Configure the nodes Make sure that all the nodes (client and servers) are running exactly the same version of JMeter.g.3. Step 2: Add the server IP to your client's Properties File Edit the properties file on the controlling JMeter machine . To revert to the previous behaviour. comma-delimited. By default. E.exitaftertest=true. Multiple such servers can be added.0. divide these between the data files) Step 1: Start the servers To run JMeter in remote node. define the JMeter property server. "remote_hosts". Since JMeter 2. Alternatively use different content in any datafiles used by the test (e. As far as possible. Using different versions of Java may work . This has the same effect as using -r and -Jremote_hosts={serverlist}. See also the -X flag (described below) . These properties will be picked up when the server is started and may be used in the test plan to affect its behaviour (e.host2 If you define the JMeter property server.rmi. and add the value of your running JMeter server's IP address.

define a property in all the servers (may appear more than once) -Z .bat". start the client with the script "bin/jmeter. define the JMeter property server. .jmx -R server1. you can start the remote server(s) from a non-GUI (command-line) client.3. These menus contain the client that you set in the properties file.create=false on the server host systems and follow the instructions below.Run Menu Step 3b: Start the JMeter from a non-GUI Client As an alternative.1 Doing it Manually In some cases.1. use the script "bin/jmeter". 15. The command-line client will exit when all the remote servers have stopped.server2. The first example will start whatever servers are defined in the JMeter property remote_hosts. Other flags that may be useful: -Gproperty=value . Here is how to start the JMeter servers (step 1 above) with a more manual process: Step 1a: Start the RMI Registry Since JMeter 2. To revert to the previous behaviour.rmi. so this section does not apply in the normal case. the jmeter-server script may not work for you (if you are using an OS platform not anticipated by the JMeter developers). The command to do this is: jmeter -n -t script.jmx -r or jmeter -n -t script. the second example will define remote_hosts from the list of servers and then run the remote servers. For MS-Windows.Step 3a: Start the JMeter Client from a GUI client Now you are ready to start the controlling JMeter client. Figure 1 . For UNIX. You will notice that the Run menu contains two new sub-menus: "Remote Start" and "Remote Stop" (see figure 1). Use the remote start and stop instead of the normal JMeter start and stop menu items... the RMI registry is started by the JMeter server.Exit remote servers at the end of the test.

logLevel=verbose" (i. you will need to make sure that they are set up to allow the connections through.0.properties file. Replace • `dirname $0`/jmeter -s "$@" With .JMeter uses Remote Method Invocation (RMI) as the remote communication mechanism. Alternatively the properties can be defined in the system. The following tips were contributed by Sergey Ten. you need to run the RMI Registry application (which is named. Use the "-s" option with the jmeter startup script ("jmeter -s").0. JMeter/RMI also requires a reverse connection in order to return sample results from the server to the client. If you see connections refused. these tips may help.2 loopback is not available. start the JMeter Server. Therefore. What happens is jmeter-server can't connect to rmiregistry if 127.0.2 Tips JMeter/RMI requires a connection from the client to the server. This will use the port you chose.jar JMETER_HOME/lib/logkit-1. "rmiregistry") that comes with the JDK and is located in the "bin" directory.1 and 127. By default the application listens to port 1099. If necessary.jar The rmiregistry application needs access to certain JMeter classes.3. the RMI registry is started by the server. This will use a high-numbered port. however the options can still be passed in from the JMeter command line. The default installation may enable the firewall. Run rmiregistry with no parameters. turn on debugging by passing the following options. use monitoring software to show what traffic is being generated. The solution to the problem is to remove the loopbacks 127. Since JMeter 2.0.0. Use the following settings to fix the problem. Step 1b: Start the JMeter Server Once the RMI Registry application is running.jar JMETER_HOME/lib/jorphan. Before running rmiregistry. 15. omit the -J prefixes).2. If you're running Suse Linux. If there are any firewalls or other network filters between JMeter client and server. default 1099. make sure that the following jars are in your system claspath: • • • JMETER_HOME/lib/ext/ApacheJMeter_core. For example: "jmeter -s -Dsun.loader. Steps 2 and 3 remain the same. In that case.e.2 from etc/hosts.0.rmi. remote testing will not work properly.1.

send a summary sample when either the count or time exceeds a threshold. This may use a lot of memory on the server. For example.default is Standard o Standard .1. all the following need to agree: On the server.server. This can place a large load on the network and the JMeter client.sample sending mode . assume you want to use port 1664 (perhaps 1099 is already used). the script starts rmiregistry on the specified port. On Windows (in a DOS box) C:\JMETER> SET SERVER_PORT=1664 C:\JMETER> JMETER-SERVER [other options] On Unix: $ SERVER_PORT=1664 jmeter-server [other options] [N.HOST="-Djava. 15. There are some JMeter properties that can be set to alter this behaviour. the jmeter-server scripts provide support for changing the port.log file (rmiregistry does not create a log file). o Batch . having defined the "server_port" property.3 Using a different port By default.send saved samples when either the count or time exceeds a threshold o Statistical .rmi. start rmiregistry using the new port number On the server.security.hostname=[computer_name] [computer_domain] • -Djava.4 Using sample batching Listeners in the test plan send their results back to the client JMeter which writes the results to the specified files By default.send samples as soon as they are generated o Hold . start JMeter with the property server_port defined On the client. • mode . update the remote_hosts property to include the new remote host:port settings • • • Since Jmeter 2.policy=`dirname $0`/[policy_file]" • `dirname $0`/jmeter $HOST -s "$@" • Also create a policy file and add [computer_name][computer_domain] line to /etc/hosts. and then starts JMeter in server mode. For this to work successfully. JMeter uses the standard RMI port 1099.hold samples in an array until the end of a run. samples are sent back as they are generated. It is possible to change this. use upper case for the environment variable] In both cases.1. 15. The samples are summarised by thread .B. The chosen port will be logged in the server jmeter.

16. o o The following properties apply to the Batch and Statistical modes: • • num_sample_threshold . consider running multiple non-GUI JMeter instances on multiple machines.2 Where to Put the Cookie Manager See Building a Web Test for information. there's no point in recording image requests (JMeter can be instructed to download all images on a page .group name and sample label. the more inflated the timing information gets.asp.see HTTP Request ). .1 Limit the Number of Threads Your hardware's capabilities will limit the number of threads you can effectively run with JMeter. there is an extension all your files share.jsp. the more each thread has to wait to get access to the CPU. These will just clutter your test plan. . the less accurate its timing information will be.remove responseData from succesful samples StrippedBatch . 16.html or the like. For instance.number of milliseconds to wait (default 60 seconds) 16. Best Practices 16. The more work JMeter does. . Most likely. The more JMeter works. It will also depend on how fast your server is (a faster server gives makes JMeter work harder since it returns request quicker). Stripped . The following fields are accumulated:  elapsed time  latency  bytes  sample count  error count Other fields that vary between samples are lost.4 Using the Proxy Server Refer to HTTP Proxy Server for details on setting up the proxy server.php. and send as batches o Custom implementation : set the mode parameter to your custom sample sender class name. The most important thing to do is filter out all requests you aren't interested in. such as . This must implement the interface SampleSender and have a constructor which takes a single parameter of type RemoteSampleListener. If you need large-scale load testing.3 Where to Put the Authorization Manager See Building an Advanced Web Test for information.remove responseData from succesful samples. These you should "include" by .number of samples in a batch (default 100) time_threshold . 16.

if you are testing an app on server "xxx.1. Some browsers ignore proxy settings for localhost or 127. For example: Create a text file containing the user names and passwords. 16.*\. javascript files. you can have JMeter automatically replace values in you recorded samples. then you can define a variable called "server" with the value of "xxx. Name the variables USER and PASS. For example. Put this in the same directory as your test plan. The Proxy Server expects to find a ThreadGroup element with a Recording Controller under it where it will record HTTP Requests to. and then erase and start fresh. One of the most useful features of the Proxy Server is that you can abstract out certain common elements from the recorded samples. By defining some user-defined variables at the Test Plan level or in User Defined Variables elements. Please note that matching is case-sensitive.example. and anyplace that value is found in your recorded samples will be replaced with "${server}". then the browser cannot be using the proxy. separated by commas. This is easy to achieve with the facilities provided by JMeter. and the browser has not accepted the JMeter Proxy server certificate. go through the steps of a Test Case.0.com".jsp" as an "Include Pattern". Alternatively.entering ". Test out your settings to verify you are recording what you want. Depending on your application. use JMeter to record your actions to define your test cases. save the entire test case in an appropriately named file. • Add a CSV DataSet configuration element to the test plan. If you have no pre-defined test cases.5 User variables Some test plans need to use different values for different users/threads. By doing this. you might want to test a sequence that requires a unique login for each user. which can be given a name that describes the test case. If JMeter does not record any samples. • Replace the login name with ${USER} and the password with $ • . For instance. you can quickly record a large number of test case "rough drafts". you can exclude images by entering ".gif" as an "Exclude Pattern". If the browser works OK even if JMeter is not running.example. wipe clean and start a new test case. This conveniently packages all your samples under one controller. Once you have finished a definite series of steps. this may or may not be a better way to go. try using the local hostname or IP instead. and other included files. Now. The error "unknown_ca" probably means that you are trying to record HTTPS. Then.0.com".*\. check that the brower really is using the proxy. You may also have to exclude stylesheets.

properties: beanshell. There is no security.it can act as a server. This avoids wasting resources at runtime. and can be used to define various functions and set up variables. Do not enable the server unless the ports are protected against access. 16. if using the -l flag as above they can all be deleted or disabled.server. If you do wish to use the server. use the same sampler in a loop. 16. Use non-GUI mode: jmeter -n -t test. and use variables (CSV Data Set) to vary the sample.bsh file will be processed by the server.particularly if it needs to be randomised . define the following in jmeter. Or perhaps use the Access Log Sampler.bsh In the above example. Port 9001 will be used for telnet access. as it adds all the test elements in the file to the test plan.port=9000 beanshell.jmx -l test. e. The startup file defines methods for setting and printing JMeter and system properties. • Rather than using lots of similar samplers. The startup.{PASS} on the appropriate samplers The CSV Data Set element will read a new line for each thread.server./extras/startup.. which is accessible by telnet or http.7 BeanShell server The BeanShell interpreter has a very useful feature .g.file=.create the test data in a file that can be read with CSV Dataset.] • Don't use functional mode • Use CSV output rather than XML • Only save the data that you need • Use as few Assertions as possible • • If your test needs large amounts of data . the server will be started. by a firewall. These can provide unrestricted access to the JMeter application and the host. [The Include Controller does not help here.6 Reducing resource requirements Some suggestions on reducing resource usage. and will listen on ports 9000 and 9001.jtl Use as few Listeners as possible. This is what you should see in the JMeter console: . Anyone who can connect to the port can issue any BeanShell commands. Port 9000 will be used for http access.

decode(args[3]).bsh 70 5 100 60 16.8.8.curr. // Final value secs=Integer./lib/bshclient.8 BeanShell scripting 16.jar localhost 9000 throughput. You can test BeanShell scripts outside JMeter by using the command-line interpreter: $ java -cp bsh-xxx. if this is the case try using the reset option. within a loop. and you want to vary the throughput at various times during the test. and sent to the server using bshclient. The test-plan includes a Constant Throughput Timer which is defined in terms of a property. then the interpreter is retained between invocations unless the "Reset bsh..g.bsh. } printprop("throughput"). e. The following BeanShell commands could be used to change the test: printprop("throughput").other jars as needed] bsh.Startup script running Startup script completed Httpd started on port: 9000 Sessiond started on port: 9001 As a practical example. For example: java -jar .1 Overview Each BeanShell test element has its own copy of the interpreter (for each thread).2 Sharing Variables .decode(args[1]).g.Interpreter before each call" option is selected.decode(args[0]). // Wait between changes while(curr <= end){ setprop("throughput". assume you have a long-running JMeter test running in non-GUI mode.jar. say). curr=Integer. Some long-running tests may cause the interpreter to use lots of memory. // or use EOF key (e.bsh [parameters] or $ java -cp bsh-xxx.Interperter bsh% source("file. The script can be stored in a file (throughput.bsh"). If the test element is repeatedly called.g.jar[. curr += inc.Interperter file. e.toString()).jar bsh. ^Z or ^D) 16. bsh% exit().decode(args[2]). $ {__P(throughput)}. // Needs to be a string here Thread.sleep(secs*1000). // Start value inc=Integer. // Increment end=Integer.

There is no need to escape any commas in the script. JMeterUtils. for example: vars. because the function call is parsed before the variable's value is interpolated. unless the reset option is used. these will show up in the Tree View. However.getPropDefault("name". The function call can then be coded as $ {__BeanShell(${RANDOM_NAME})} .\ Scripts can also access JMeter variables using the get() and put() methods of the "vars" variable.jmeter. Create a simple Test Plan containing the BSF Sampler and Tree View Listener.file". it can be stored as a variable on the Test Plan. Also the result of running the script will show up as the response. . but can be used by all test elements (not just Beanshell). If you need to share variables between threads. Once the script is working properly. String value=JMeterUtils. "value"). The script variable can then be used to create the function call. For example: if (bsh. vars. It's quite hard to write and test scripts as functions.10 Parameterising tests Often it is useful to be able to re-run the same test with different settings. For example. then JMeter properties can be used: import org. This is only processed once. The get() and put() methods only support variables with String values.init. The sample .shared.myObj == void){ // not yet defined.bshrc files contain sample definitions of getprop() and setprop() methods.put("MSG". Code the script in the sampler script pane. JMeter has the BSF (and BeanShell) samplers which can be used instead. it can be created in the startup file defined by the JMeter property "beanshell. } bsh.util. JMeter variables are local to a thread.setProperty("name". suppose a BeanShell script is stored in the variable RANDOM_NAME. Another possible method of sharing variables is to use the "bsh.get("HOST").shared" shared namespace. .shared. For example. Rather than creating the object in the test element. 16.apache. so create it: myObj=new AnyObject().9 Developing script functions in BeanShell. but there are also getObject() and putObject() methods which can be used for arbitrary objects."")."Successful"). Javascript or Jexl etc. These will be retained across invocations of the test element. 16.myObj.process().Variables can be defined in startup (initialisation) scripts.JMeterUtils. If there are any errors. and test it by running the test.

2 Resources The following resources will prove very helpful. just change the value of the LOOPS variable on the Test Plan. The appropriate property file can be passed in to JMeter using the -q command-line option. it is worth knowing who the following people are. session-rewriting.10))} . As well. There are a number of questions to be asked first. To run the test with 20 loops. you will become these resources. You will need some hardware to run the benchmarks/load-tests from. defaulting to 10 if the property is not found. If there are a lot of properties that need to be changed together.1 Network Who knows our network topology ? If you run into any firewall or proxy issues.. One way to do this is to define a set of variables on the Test Plan. And finally.. off-hours or week-ends). There are a number of products to consider. a private testing network (which will therefore have very low network latency) would be a very nice thing. The "loops" property can then be defined on the JMeter command-line: jmeter . how does our application manage it (cookies. This quickly becomes tedious if you want to run lots of tests in non-GUI mode. this will become very important. If the application doesn't scale as expected. For example. Bear in mind that if you cannot locate these resources. or some other method) ? What is the testing intended to achieve? 17.e. or changing a hostname. and additionally a number of resources that will be needed. 17.. A number of tools will prove useful. One solution to this is to define the Test Plan variable in terms of a property. Knowing who can set one up for you (if you feel that this is necessary) will be very useful.2. then one way to achieve this is to use a set of property files. and then use those variables in the test elements. As you already have your work cut out for you.changing the number of threads or loops. so that you can ask them for help if you need it. one could define the variable LOOPS=10. . This uses the value of the property "loops".1 Questions to ask What is our anticipated average number of users (normal load) ? What is our anticipated peak number of users ? When is a good time to load-test our application (i. who can add additional hardware ? . for example LOOPS=$ {__P(loops. why is Java a good choice to implement a loadtesting/Benchmarking product. and refer to that in the Thread Group as ${LOOPS}.. -Jloops=12 . bearing in mind that this may very well crash one or more of our servers ? Does our application have state ? If so. 17. 17. Help! My boss wants me to load test our web app! This is a fairly open-ended proposition.

It is definitely worthwhile to become familiar with them. or you can use CSV output and import the data into a spreadsheet. For Windows. and Solaris Intel. Remember.e. For non-Windows platforms. Good free platforms include the linuxes. and you probably anticipate more users than that). You might as well make it as easy for this person as you possibly can. 17. Windows XP Professional should be a minimum (the others do not multithread past 50-60 connections. and reading the appropriate documentation (man- . 17. the first thing your clients will do is hire a graduate student to verify them. This can be useful if you have a powerful server that supports Java but perhaps does not have a fast graphics implementation. if you publish your results.bashrc or . Batch (non-GUI) mode can reduce the network traffic compared with using a remote display or client-server mode. there are commercial linuxes. investigate "ulimit -n unlimited" with a view to including it in your user account startup scripts (.cshrc scripts for the testing account). so be prepared to defend your work.2 Application Who knows how our application functions ? The normal sequence is test (low-volume . vanilla) software installation.4 Tools The following tools will all prove useful.17.can we benchmark our application?) • benchmark (the average number of users) • load-test (the maximum number of users) • test destructively (what is our hard limit?) • The test process may progress from black-box testing to white-box testing (the difference is that the first requires no knowledge of the application [it is treated as a "black box"] while the second requires some knowledge of the application). Don't forget JMeter batch mode. Remember to include the hardware/software configuration in your published benchmarks. This should include trying them out. It is not uncommon to discover problems with the application during this process.2. The batch log file can then be loaded into JMeter on a workstation for analysis. the BSDs. If you have a little more money. If you can justify it. a commercial Unix (Solaris. this platform will become the limiting factor. or where you need to login remotely. etc) is probably the best choice. with a standard (i. So it's worth using the best hardware and software that you have available. As you progress to larger-scale benchmarks/load-tests.3 What platform should I use to run the benchmarks/load-tests ? This should be a widely-used piece of hardware.

5. In fact. if you are reading this . then this solution offers an open-source community to provide them (of course. It can also be used to estimate the overall network latency (running locally should give the lowest possible network latency .4.pages. 17. these products do not do exactly what you want. This product is free to evolve along with your requirements. 17. 17. this may be used to determine the problem (possibly a firewall or a proxy). Written in 'C'. 17. which generally have fairly hefty pricetags. 17. it performs very well.5 What other products are there ? There are a number of commercial products.remember that your users will be running over a possibly busy internet). . be aware that the functionality of this product is not likely to change. 17. the fewer hops the better. and offers good (if basic) performance reporting.1 Apache 'ab' tool You should definitely start with this one. and any supplied documentation). If this is the case. application --help messages. info-files.2 HttpUnit This is worth a look.3 traceroute If you cannot "ping" your target site. 17. or you are on a limited budget. and can be made to handle HTTP 'post' requests with a little effort.5. as it may very well do the job if your requirements are not particularly complicated. Generally.3 Microsoft WAS This is definitely worth a look. It is a library (and therefore of more interest to developers) that can be used to perform HTTP tests/benchmarks.4 JMeter If you have non-standard requirements. 17. you may wish to avoid the overhead of DNS lookups when performing benchmarking/load-testing. you are probably already committed to this one). If you can justify it. These can be used to determine the unique address (dotted quad) of your target site.5. It has an excellent user interface but it may not do exactly what you want.4. It is intended to be used instead of a web browser (therefore no GUI) in conjunction with JUnit . these are probably the way to go. It handles HTTP 'get' requests very well.1 ping This can be used to establish whether or not you can reach your target site. however. the following are worth a look.4. you should probably start by trying the Apache ab tool.5. Options can be specified so that 'ping' provides the same type of route reporting as 'traceroute'.2 nslookup/dig While the user will normally use a human-readable internet address. If.

and URL-rewriting). and JDBC (not to mention cookies. and state management code that you will need to benchmark your application.17.6 Why Java ? Why not Perl or C ? Well. C. is a very good choice (check out the Apache ab tool). • • 18. of course. and HTTPS . Perl might be a very good choice except that the Benchmark package seems to give fairly fuzzy results. and byte-code level security. they will be processes). IIOP. Java gives you (for free) the custom networking. URL-encoding. but these will not be threads.2 Logic Controllers o Simple Controller . If you find that someone has already written something that seems useful. In addition Java gives you automatic garbage-collection. Also. However. Java is aware of HTTP. threading. the Perl community is very large. this could be a very good solution.1 Samplers o FTP Request o HTTP Request o JDBC Request o Java Request o SOAP/XML-RPC Request o WebService(SOAP) Request o LDAP Request o LDAP Extended Request o Access Log Sampler o BeanShell Sampler o BSF Sampler o JSR223 Sampler o TCP Sampler o JMS Publisher o JMS Subscriber o JMS Point-to-Point o JUnit Request o Mail Reader Sampler o Test Action o SMTP Sampler 18. But be prepared to write all of the custom networking. and state management code that you will need to benchmark your application. FTP. And once Microsoft moves to a CLR (common language run-time) a Windows Java solution will not be any slower than any other type of solution on the Windows platform. simulating multiple users with Perl is a tricky proposition (multiple connections can be simulated by forking many processes from a shell script.as well as RMI. threading.

3 Listeners o Sample Result Save Configuration o Graph Full Results o Graph Results o Spline Visualizer o Assertion Results o View Results Tree o Aggregate Report o View Results in Table o Simple Data Writer o Monitor Results o Distribution Graph (alpha) o Aggregate Graph o Mailer Visualizer o BeanShell Listener o Summary Report o Save Responses to a file o BSF Listener o JSR223 Listener o Generate Summary Results o Comparison Assertion Visualizer 18.• • Loop Controller Once Only Controller Interleave Controller Random Controller Random Order Controller Throughput Controller Runtime Controller If Controller While Controller Switch Controller ForEach Controller Module Controller Include Controller Transaction Controller Recording Controller 18.4 Configuration Elements o CSV Data Set Config o FTP Request Defaults o HTTP Authorization Manager o HTTP Cache Manager o HTTP Cookie Manager o HTTP Request Defaults o HTTP Header Manager o Java Request Defaults o JDBC Connection Configuration o Login Config Element o LDAP Request Defaults o LDAP Extended Request Defaults o o o o o o o o o o o o o o o .

9 Miscellaneous Features o Test Plan o Thread Group o WorkBench o SSL Manager o o o o o .• • • • • TCP Sampler Config User Defined Variables Random Variable Counter Simple Config Element 18.6 Timers o Constant Timer o Gaussian Random Timer o Uniform Random Timer o Constant Throughput Timer o Synchronizing Timer o BeanShell Timer o BSF Timer o JSR223 Timer 18.8 Post-Processors o Regular Expression Extractor o XPath Extractor o Result Status Action Handler o BeanShell PostProcessor o BSF PostProcessor o JSR223 PostProcessor 18.5 Assertions o Response Assertion o Duration Assertion o Size Assertion o XML Assertion o BeanShell Assertion o MD5Hex Assertion o HTML Assertion o XPath Assertion o XML Schema Assertion o BSF Assertion o JSR223 Assertion o Compare Assertion o SMIME Assertion 18.7 Pre Processors o HTML Link Parser o HTTP URL Re-writing Modifier o HTML Parameter Mask o HTTP User Parameter Modifier o User Parameters o BeanShell PreProcessor o BSF PreProcessor o JSR223 PreProcessor 18.

HTTP Proxy Server HTTP Mirror Server Property Display Debug Sampler Debug PostProcessor 18.10 Reports o Report Plan o Report Table o HTML Report Writer o Report Page o Line Graph o Bar Chart
o o o o o

18.1 Samplers

Samplers perform the actual work of JMeter. Each sampler (except Test Action) generates one or more sample results. The sample results have various attributes (success/fail, elapsed time, data size etc) and can be viewed in the various listeners.

18.1.1 FTP Request
This controller lets you send an FTP "retrieve file" or "upload file" request to an FTP server. If you are going to send multiple requests to the same FTP server, consider using a FTP Request Defaults Configuration Element so you do not have to enter the same information for each FTP Request Generative Controller. When downloading a file, it can be stored on disk (Local File) or in the Response Data, or both. Latency is set to the time it takes to login (versions of JMeter after 2.3.1). Control Panel

Parameters Attribute Name Description Descriptive name for this controller that is shown in the tree. No Yes No Yes Yes, if uploading (*) Yes, if uploading (*) Yes Required

Server Name or Domain name or IP address of the FTP server. IP Port Remote File: Local File: Local File Contents: get(RETR) / Port to use. If this is >0, then this specific port is used, otherwise JMeter uses the default FTP port. File to retrieve or name of destination file to upload. File to upload, or destination for downloads (defaults to remote file name). Provides the contents for the upload, overrides the Local File property. Whether to retrieve or upload a file.

Parameters
Attribute Name Description Descriptive name for this sampler that is shown in the tree. The WSDL URL with the service description. Versions of JMeter after 2.3.1 support the file: protocol for local WSDL files. Will be populated from the WSDL when the Load WSDL button is pressed. Select one of the methods and press the Configure button to populate the Protocol, Server, Port, Path and SOAPAction fields. HTTP or HTTPS are acceptable protocol. The hostname or IP address. Port Number. Path for the webservice. The SOAPAction defined in the webservice description or WSDL. The Soap XML message File containing soap message Folder containing soap files When using external files, setting this causes the file to be processed once and caches the result. This may use a lot of memory if there are many different large files. Check box if http proxy should be used Proxy hostname Proxy host port Requir ed No

WSDL URL

No

Web Methods Protocol Server Name or IP Port Number Path SOAPAction Soap/XMLRPC Data Soap file Message Folder Memory cache Use HTTP Proxy Proxy Host Proxy Port

No

Yes Yes Yes Yes Yes Yes No No

Yes

No No No

18.1.7 LDAP Request
This Sampler lets you send a different Ldap request(Add, Modify, Delete and Search) to an LDAP server. If you are going to send multiple requests to the same LDAP server, consider using an LDAP Request Defaults Configuration Element so you do not have to enter the same information for each LDAP Request. The same way the Login Config Element also using for Login and password.

the created entry will be deleted from the LDAP Server. Add Test 1. After execution of the test.The entries are collected from the table to add. User defined Test cases. Inbuilt test : This will add a pre-defined entry in the LDAP Server and calculate the execution time. Inbuilt Test cases. User defined test : This will add the entry in the LDAP Server. The created entry will not be deleted after the test. 2. The execution time is calculated. . 1.Control Panel There are two ways to create test cases for testing an LDAP Server. The tests are given below: 1. There are four test scenarios of testing LDAP. 2. User has to enter all the attributes in the table.

Inbuilt test : This will create a pre-defined entry first. Search Test 1. User defined test This will modify the entry in the LDAP Server. The entry will not be deleted from the LDAP Server.And calculate the execution time. User defined test This will search the user defined entry(Search filter) in the Search base (again. 2. The entries are collected from the table to modify. At the end of the execution. Inbuilt test : This will create the entry first. Delete Test 1.created entry will be deleted from the LDAP Server.2. 2. Port root DN default port(389). The execution time is calculated. After execution of the test. The entries should be available in the LDAP Server. then will search if the attributes are available. 4. 2. User defined test This will delete the user-defined entry in the LDAP Server. It calculates the execution time of the search query. then will modify the created entry in the LDAP Server. the created entry will be deleted from the LDAP Server. Inbuilt test : This will create a pre-defined entry first. The execution time is calculated. Modify Test 1. 3. The entries should be available in the LDAP Server. DN for the server to communicate . JMeter assumes or IP the LDAP server is listening on the default port(389). The execution time is calculated. User has to enter all the attributes in the table. Required No Yes Yes Yes Server Name Domain name or IP address of the LDAP server. Parameters Attribute Name Description Descriptive name for this controller that is shown in the tree. The execution time is calculated. then it will be deleted from the LDAP Server. defined by the user).

may not be empty Example: do you want to add cn=apache. but can be made much closer resembling a real LDAP session. If you are going to send multiple requests to the same LDAP server.1. Usually Usually the name of the context to create or Modify. value pair to added in the given context object this name. LDAP server password. Control Panel . may not be empty Yes Yes Yes Yes Yes Search base the name of the context or object to search Search filter the filter expression to use for the search. value=apache the name of the context to Delete. It is an extended version of the LDAP sampler.Username Password Entry DN Delete LDAP server username. therefore it is harder to configure.8 LDAP Extended Request This Sampler can send all 8 different LDAP request to an LDAP server.ou=test you have to add in Yes table name=cn. value pair to add or modify in the given context object Building an Ldap Test Plan LDAP Request Defaults 18. may not be null add test modify test See Also: • • this name. consider using an LDAP Extended Request Defaults Configuration Element so you do not have to enter the same information for each LDAP Request.

Required No Yes No Servername The name (or IP-address) of the LDAP server. Parameters Attribute Name Description Descriptive name for this sampler that is shown in the tree. For starting this session a thread bind is used. an anonymous session is started. omitting the password will not fail this test. You cannot start any operation on a higher level than this DN! Full distinguished name of the user as which you want to bind. Take care. Thread bind Any LDAP request is part of an LDAP session. a wrong password will. The user is requested to give a username (Distinguished name) and password. It can be used as a starting point for all operations. Port DN No Username No . which will be used to initiate a session. The port number that the LDAP server is listening to. so the first thing that should be done is starting a session to the LDAP server. or the wrong password is specified.There are nine test operations defined. If this is omitted JMeter assumes the LDAP server is listening on the default port(389). which is equal to the LDAP "bind" operation. When no password. These operations are given below: 1. The distinguished name of the base object that will be used for any subsequent operation.

Parameters Attribute Name Description Descriptive name for this sampler that is shown in the tree. No 3. It can be used to rename an entry. Required No Username Full distinguished name of the user as which you want to bind. It can be used for an authentication request/password check for any user. just to check the validity of the user/password combination. and end the session again.Password Password for the above user. It is equal to the LDAP "unbind" operation. . the sampler will return an error. If is is incorrect. 2. Required No The current distinguished name of the object you want to rename or move. If is is incorrect. the sampler will return an No error and revert to an anonymous bind. Rename entry This is the LDAP "moddn" operation. Yes Password for the above user. If omitted it will result in an anonymous bind. Single bind/unbind This is a combination of the LDAP "bind" and "unbind" operations. relative to the given DN in the Yes thread bind operation. If omitted it will result in an Password anonymous bind. Thread unbind This is simply the operation to end a session. It will open an new session. Parameters Attribute Name Description Required Descriptive name for this sampler that is shown in the tree. but also for moving an entry or a complete subtree to a different place in the LDAP tree. No 4. Parameters Attribute Name Old entry name Description Descriptive name for this sampler that is shown in the tree.

5. Distinguished name of the object you want to add. It can be used to add any kind of object to the LDAP server. If you need to add a multiple value attribute. relative to the given DN in the thread Yes bind operation. it can be used to delete an object from the LDAP tree Parameters Attribute Name Delete Description Descriptive name for this sampler that is shown in the tree. Required No Distinguished name of the object you want to delete. Delete test This is the LDAP "delete" operation. relative to Yes the given DN in the thread bind operation. 7. Parameters Attribute Name Entry DN Description Descriptive name for this sampler that is shown in the tree. relative to the given DN in the thread bind operation. Parameters Attribute Name Search base Description Required Descriptive name for this sampler that is shown in the tree. Search test This is the LDAP "search" operation. No Distinguished name of the subtree you want your search to No . A list of attributes and their values you want to use for the object. Required No Yes Add test Yes 6. and will be used for defining searches.New distinguished name The new distinguished name of the object you want to rename or move. Add test This is the ldap "add" operation. you need to add the same attribute with their respective values several times to the list.

9. must be specified in LDAP syntax. Scope Use 0 for baseobject-. In reality this is mostly used to check . The opCode can be any valid LDAP operationCode (add. it will fail with errorcode 4 Specify the maximum amount of (cpu)time (in miliseconds) that the server can spend on your search. it will not follow No them (default=false) 8. this does not say anything about the responsetime. delete/remove or replace). which means no limit) Specify the attributes you want to have returned. which means no limit. Compare This is the LDAP "compare" operation. If you do Yes test specify a value in a delete operation. Search Filter searchfilter. all Modification values of the given attribute will be deleted. relative to the given DN in the thread bind operation Required Descriptive name for this sampler that is shown in the tree. if false.and 2 for a subtree search. It can be used to add.) When No the sampler hits the maximum number of results. It can be used to compare the value of a given attribute with some already known value. (Default=0) Yes No Size Limit Specify the maximum number of results you want back from the server. An empty field will return all attributes Whether the object will be returned (true) or not (false). 1 for onelevel. No Yes The attribute-value-opCode triples. delete or replace values of an attribute. Modification test This is the LDAP "modify" operation. Default=false No Time Limit Attributes Return object Dereference aliases If true. If this value is non-existent.look in. It can be used to modify an object. it will dereference aliases. (default=0. only the given value will be deleted. (default is 0. the sampler will fail the test. Parameters Attribute Name Entry name Description Distinguished name of the object you want to modify. relative to the given DN in the thread bind operation. If you don't specify a value with a delete operation. Take No care. seperated No by a semicolon.

Everything else is stripped out and igored. This means any webserver that uses the common log format can use the AccessLogSampler. but I haven't figured out how to link to the pre-processor. The current distinguished name of the object of which you want to compare an attribute. There is a filter for the access log parser.whether a given person is a member of some group. changes to the sampler will be made to enable that functionality. Parameters Attribute Name Entry DN Compare filter See Also: • • Description Descriptive name for this sampler that is shown in the tree.. with the values in the attribute "member" of an object of the type groupOfNames. the response code is completely ignored by the parser. For the future. There are two interfaces you have to implement. and SunOne.jsp?%2Findex. Weblogic.1. Resin.0. For example.jsp= HTTP/1. If the compare operation fails. The current implementation is complete. For those not familiar with the access log. relative to the given DN in the thread bind operation. . it is the log the webserver maintains of every request it accepted. Server that use common log format include: Tomcat. Extending the sampler should be fairly simple. it might be nice to filter out entries that do not have a response code of 200.1" 200 8343 The current implemenation of the parser only looks at the text within the quotes. but some features have not been enabled. This means the every image and html file. this test fails with errorcode 49. Tomcat uses the common format for access logs.1 .0.[21/Oct/2003:05:37:21 -0500] "GET /index. In the form "attribute=value" Required No Yes Yes Building an LDAP Test Plan LDAP Extended Request Defaults 18. In such a case you can compare the DN of the user as a given value.9 Access Log Sampler (Alpha Code) AccessLogSampler was designed to read access logs and generate http requests. Common log format looks like this: 127. Once I do.

After that. the parser is called with integer 1.isImageParser()).accesslog.accesslog. res.generateRequest().protocol.http. samp. For an example of how to implement either interface. samp.http.sample().util.setSampleLabel(samp.jmeter. The servername. samp = (HTTPSampler) GENERATOR.Generator The current implementation of AccessLogSampler uses the generator to create a new HTTPSampler.apache.util.LogParser org.toString()).sample() is called to make the request. refer to StandardGenerator and TCLogParser.setImageParser(this.org. HTTPSampler. Classes implementing Generator interface should provide concrete implementation for all the methods. res = samp.setDomain(this. The required methods in LogParser are: setGenerator(Generator) and parse(int).setPort(this. Next.protocol.parse(1). samp.getDomain()).apache. telling it to parse one entry. port and get images are set by AccessLogSampler. PARSER. Control Panel .getPort()).jmeter.

StartTLS=587 The from address that will appear in the e-mail The destination e-mail address Yes Required Yes. Port to be used to connect to the server. See below for Yes use with file protocol. SSL=465.Parameters Attribute Server Port Address From Address To Description Hostname or IP address of the server. unless CC or . Defaults are: No SMTP=25.

Files to be attached to the message.eml Calculate message size Enable debug logging? The e-mail message subject.B.currentTimemilis() in the subject line. Message. If the server does not start the TLS protocol the connection will be terminated. against the directory containing the test script (JMX file). this is stored unencrypted No in the test plan) Indicates that the connection to the SMTP server does not use any security protocol.BCC is specified Address To BCC Blind carbon copy destinations e-mail address Address To CC Use Auth Username Password Use no security features Use SSL Use StartTLS Enforce StartTLS Trust All Certificates Use local truststore Carbon copy destinations e-mail address Indicates if the SMTP server requires user authentication User login name No No No No User login password (N. No If set. Relative paths are resolved against the current directory. Indicates that the connection to the SMTP server must use the SSL protocol. Indicates that the connection to the SMTP server should attempt to start the TLS protocol. the . and Attached files Calculates the message size and stores it in the sample result.eml file will be sent instead of the entries No in the Subject. No No Additional headers can be defined using this button. Includes the System. No No No No No When selected it will only accept certificates that are No locally trusted. No No If set.debug" property is set to "true" No . No The message body. Path to file containing the trusted certificates. then the "mail. Failing that. When selected it will accept all certificates independent of the CA. Local truststore No Subject Include timestamp in subject Add Header Message Attach files Send .

18. the File Reporter is configured to store the results in a file named "simple-test. Figure 6 Simple Controller Example . this controller provides no functionality beyond that of a storage device. we created a Test Plan that sends two Ant HTTP requests and two Log4J HTTP requests. In this example.dat" in the current directory. JMeter sends the requests in the following order: Ant Home Page. Ant News Page.2. So. Unlike other Logic Controllers. No Using the Simple Controller Download this example (see Figure 6). Remember.2 Logic Controllers Logic Controllers determine the order in which Samplers are processed.1 Simple Controller The Simple Logic Controller lets you organize your Samplers and other Logic Controllers. the Simple Logic Controller has no effect on how JMeter processes the controller(s) you add to it. Control Panel Parameters Attribute Name Description Required Descriptive name for this controller that is shown in the tree. Log4J Home Page.^ 18. Note. in this example. We grouped the Ant and Log4J requests by placing them inside Simple Logic Controllers. Log4J History Page.

Yes. In this example. Instead of letting the Thread Group control the looping. Loop Count Special Case: The Loop Controller embedded in the Thread Group element behaves slightly differently. we used a Loop Controller. Figure 4 . Control Panel Parameters Attribute Name Description Descriptive name for this controller that is shown in the tree. Unless set to forever. if you add one HTTP Request to a Loop Controller with a loop count of two. unless "Forever" is checked No Required Looping Example Download this example (see Figure 4). in addition to the loop value you specified for the Thread Group. and configure the Thread Group loop count to three. JMeter will send a total of 2 * 3 = 6 HTTP Requests. it stops the test after the given number of iterations have been done.Loop Controller Example We configured the Thread Group for a single thread and a loop count value of one.2 Loop Controller If you add Generative or Logic Controllers to a Loop Controller. You can see that we added one HTTP Request to the Thread Group and another HTTP Request to a Loop . For example.2. The number of times the subelements of this controller will be iterated each time through a test run. we created a Test Plan that sends a particular HTTP Request only once and sends another HTTP Request five times.18. JMeter will loop through them a certain number of times.

No Once Only Example Download this example (see Figure 5). each JMeter thread only sends one request to the Home Page because this request lives inside a Once Only Controller. Control Panel Parameters Attribute Name Description Required Descriptive name for this controller that is shown in the tree. We configured the Loop Controller with a loop count value of five. then the Once Only Controller will execute only on the first iteration through the Loop Controller (ie. but now the user has more flexibility in the use of the Once Only Controller. we created a Test Plan that has two threads that send HTTP request. News Page. JMeter will send the requests in the following order: Home Page.dat" in the current directory. Although we configured the Thread Group to iterate three times. For testing that requires a login. the File Reporter is configured to store the results in a file named "loop-test.2. if the Once Only Controller is placed under a Loop Controller specified to loop 5 times.Controller. every 5 times). . 18. and News Page. Note. The Once Only Controller will now execute always during the first iteration of any looping parent controller. News Page. News Page. News Page. and pass over any requests under it during further iterations through the test plan. Note this means the Once Only Controller will still behave as previously expected if put under a Thread Group (runs only once per test). followed by three requests to the Bug Page. consider placing the login request in this controller since each thread only needs to login once to establish a session.3 Once Only Controller The Once Only Logic Controller tells JMeter to process the controller(s) inside it only once. Each thread sends one request to the Home Page. Thus. In this example.

Bug Page. The behaviour of the Once Only controller under anything other than the Thread Group or a Loop Controller is not currently defined. Once Only Controller Example Each JMeter thread will send the requests in the following order: Home Page. Bug Page. See the table below for the sequence JMeter sends the HTTP Requests. Simple Interleave Example Download this example (see Figure 1).Interleave Controller Example 1 . Control Panel Parameters Attribute name Description Descriptive name for this controller that is shown in the tree. for a total of ten requests per thread. Bug Page. Required No No If checked.2.4 Interleave Controller If you add Generative or Logic Controllers to an Interleave Controller. Odd things may happen.dat" in the current directory. we configured the Thread Group to have two threads and a loop count of five. Note. JMeter will alternate among each of the other controllers for each loop iteration. Figure 1 .Figure 5. 18. the interleave controller will treat sub-controllers ignore sublike single request elements and only allow one request per controller blocks controller at a time. the File Reporter is configured to store the results in a file named "loop-test. In this example.

Notice that the Test Plan has an outer Interleave Controller with two Interleave Controllers inside of it. Figure 2 . In this example. JMeter starts over and sends the first HTTP Request. each inner Interleave Controller alternates between each of the HTTP Requests. . CVS Page. Note. Bug Page.dat" in the current directory. Interleaved. Then. and FAQ Page.Loop Iteration 1 1 2 2 3 3 4 4 5 5 Each JMeter Thread Sends These HTTP Requests News Page Log Page FAQ Page Log Page Gump Page Log Page Because there are no more requests in the controller. Each JMeter thread will send the requests in the following order: Home Page. Interleaved.Interleave Controller Example 2 The outer Interleave Controller alternates between the two inner ones. Log Page FAQ Page Log Page Useful Interleave Example Download another example (see Figure 2). Interleaved. we configured the Thread Group to have a single thread and a loop count of eight. the File Reporter is configured to store the results in a file named "interleave-test2. Interleaved. which is the News Page.

Figure 3 - Interleave Controller Example 3

If the two interleave controllers under the main interleave controller were instead simple controllers, then the order would be: Home Page, CVS Page, Interleaved, Bug Page, FAQ Page, Interleaved. However, if "ignore sub-controller blocks" was checked on the main interleave controller, then the order would be: Home Page, Interleaved, Bug Page, Interleaved, CVS Page, Interleaved, and FAQ Page, Interleaved.

Parameters Attribute Name Server Port Description Descriptive name for this controller that is shown in No the tree. Domain name or IP address of the web server. Port the web server is listening to. Yes No (defaults to 80) Required

Log parser class Filter Location of log file

The log parser class is responsible for parsing the logs. The filter class is used to filter out certain lines. The location of the access log file.

Yes (default provided) No Yes

The TCLogParser processes the access log independently for each thread. The SharedTCLogParser and OrderPreservingLogParser share access to the file, i.e. each thread gets the next entry in the log. The SessionFilter is intended to handle Cookies across threads. It does not filter out any entries, but modifies the cookie manager so that the cookies for a given IP are processed by a single thread at a time. If two threads try to process samples from the same client IP address, then one will be forced to wait until the other has completed. The LogFilter is intended to allow access log entries to be filtered by filename and regex, as well as allowing for the replacement of file extensions. However, it is not currently possible to configure this via the GUI, so it cannot really be used.

18.2.5 Random Controller
The Random Logic Controller acts similarly to the Interleave Controller, except that instead of going in order through its sub-controllers and samplers, it picks one at random at each pass. Interactions between multiple controllers can yield complex behavior. This is particularly true of the Random Controller. Experiment before you assume what results any given interaction will give Control Panel

Parameters Attribute Name Description Required

Descriptive name for this controller that is shown in the tree. No

18.2.6 Random Order Controller
The Random Order Controller is much like a Simple Controller in that it will execute each child element at most once, but the order of execution of the nodes will be random. Control Panel

Parameters Attribute Name Description Required

Descriptive name for this controller that is shown in the tree. No

18.2.7 Throughput Controller
This controller is badly named, as it does not control throughput. Please refer to the Constant Throughput Timer for an element that can be used to adjust the throughput.

Instead. especially . apart from: • • • • • Simple Data Writer BeanShell/BSF Listener Mailer Visualizer Monitor Results Summary Report The following Listeners no longer need to keep copies of every single sample.jtl" extension. the header (if present) is used to determine which fields are present.3. However variable references do not work in client-server mode (functions work OK). Results can be read from XML or CSV format files. Listeners can use a lot of memory if there are a lot of samples. but is less detailed than XML (the other available option).2 used to clear any current data before loading the new file. samples with the same elapsed time are aggregated. If the previous behaviour is required. Storing as CSV is the most efficient option. and read saved test results. When reading from CSV results files. The various listeners have a panel whereby one can specify the file to which the results will be written (or read from).3 Listeners Most of the listeners perform several roles in addition to "listening" to the test results. use the menu item Run/Clear (Ctrl+Shift+E) or Run/Clear All (Ctrl+E) before loading the file. Listeners do not process sample data in non-GUI mode. thus allowing files to be merged . the results are stored as XML files.18. They also provide means to view. Versions of JMeter up to 2. use the file panel Browse button to open the file. Most of the listeners currently keep a copy of every sample in their scope. The file name can contain function and/or variable references. The saving and reading of test results is generic. In order to interpret a header-less CSV file correctly. typically with a ". Note that Listeners are processed at the end of the scope in which they are found.properties. This is no longer done. Less memory is now needed. By default. but the raw data will be saved if an output file has been configured. In order to analyse the data generated by a non-GUI test run. the appropriate properties must be set in jmeter. To read existing results and display them. save. you need to load the file into the appropriate Listener.

The entries in jmeter.if most samples only take a second or two at most. See the Listener Sample Variables for details For full details on setting up the default items to be saved see the Listener Default Configuration documentation.1 Sample Result Save Configuration . Versions of JMeter after 2.1 allow JMeter variables to be saved to the output files.properties are used to define the defaults. as shown below. use the Simple Data Writer.. Description Required No No No No No File Name Name of the file containing sample results Configure Configure Button. This can only be specified using a property. then all results are processed. see the CSV log format or the XML log format. • • • Aggregate Report Aggregate Graph Distribution Graph To minimise the amount of memory needed. The figure below shows an example of the result file configuration panel Result file configuration panel Parameters Attribute Browse..properties also apply to the listener that is added by using the -l command-line flag. File Browse Button Errors Successes Select this to write/read only results with errors Select this to write/read only results without errors.3. The settings in jmeter.3. these can be overriden for individual listeners by using the Configure button. see below 18. and use the CSV format. For details of the contents of the output files. If neither Errors nor Successes is selected.

Control Panel 18. CSV format cannot currently be used to save any items that include line-breaks.2 Graph Full Results No Description Control Panel .3. method and the query string are saved as part of the "Sampler Data" option. Note that cookies. items with (XML) only apply to XML format.Listeners can be configured to save different items to the result log files (JTL) by using the Config popup as shown below. Items with (CSV) after the name only apply to the CSV format. The defaults are defined as described in the Listener Default Configuration documentation.

plot the Average Median .3 Graph Results The Graph Results listener generates a simple graph that plots all sample times. the current sample (black).plot the actual data values Average . Further details on the precise meaning of the statistical terms can be found on the web .or by consulting a book on statistics.g. the current standard deviation (red). the current average of all samples(blue).your server in fact handled that many requests per minute.plot the Median (midway value) Deviation . Wikipedia . and you can increase the number of threads and/or decrease the delays to discover your server's maximum throughput. • • • • Data .18. The throughput number represents the actual number of requests/minute the server handled. Whereas if you made calculations that factored out delays and JMeter's processing.plot the Standard Deviation (a measure of the variation) . The advantage of doing the calculation like this is that this number represents something real . and the current throughput rate (green) are displayed in milliseconds. Along the bottom of the graph. it would be unclear what you could conclude from that number.e. Control Panel The following table briefly describes the items on the graph.3. This calculation includes any delays you added to your test and JMeter's own internal processing time.

4 Spline Visualizer The Spline Visualizer provides a view of all sample times from the start of the test till the end. The spline has 10 points. 18.3. It also reports failures of any Assertions that are part of the test plan.plot the number of samples per unit of time The individual figures at the bottom of the display are the current values. regardless of how many samples have been taken.• Throughput .3. The graph is automatically scaled to fit within the window. Control Panel . each representing 10% of the samples. "Latest Sample" is the current elapsed sample time. shown on the graph as "Data". and connected using spline logic to show a single continuous line.5 Assertion Results The Assertion Results visualizer shows the Label of each sample taken. Control Panel 18. This needs to be borne in mind when comparing graphs.

It does not show any headers (such as Host) that may be added by the HTTP protocol implementation.jmeter. selectable by a drop-down box at the bottom of the left hand panel. image/ audio/ video/ If there is no content-type provided. allowing you to view the response for any sample. Note that this will only work if the response content-type is considered to be text.ResultRenderer and/or extend the abstract class org.visualizers.g. There are several ways to view the response. it is considered as binary.6 View Results Tree The View Results Tree shows a tree of all sample responses. In addition to showing the response.3. If the content-type begins with any of the following.jmeter. and the compiled code must be available to JMeter (e.apache. The class must implement the interface org. you can see the time it took to get this response. Note that the Request panel only shows the headers added by JMeter.visualizers. • • • • • • HTML HTML (download embedded resources) JSON Regexp Tester Text XML Additional renderers can be created. then the content will not be displayed in the any of the . and some response codes. by adding it to the lib/ext directory).apache.See Also: • Response Assertion 18. otherwise it is considered to be text. The default "Text" view shows all of the text contained in the response.SamplerResultTab .

Response Data panels. You can use Save Responses to a file to save the data in this case. Note that the response data will still be available in the sample result, so can still be accessed using Post-Processors. If the response data is larger than 200K, then it won't be displayed. To change this limit, set the JMeter property view.results.tree.max_size . You can also use save the entire response to a file using Save Responses to a file . The HTML view attempts to render the response as HTML. The rendered HTML is likely to compare poorly to the view one would get in any web browser; however, it does provide a quick approximation that is helpful for initial result evaluation. No images etc are downloaded. If the HTML (download embedded resources) option is selected, the renderer may download images and style-sheets etc referenced by the HTML. The XML view will show response in tree style. Any DTD nodes or Prolog nodes will not show up in tree; however, response may contain those nodes. The JSON view will show the response in tree style (also handles JSON embedded in JavaScript). Most of the views also allow the displayed data to be searched; the result of the search will be high-lighted in the display above. For example the Control panel screenshot below shows one result of searching for "Java". Note that the search operates on the visible text, so you may get different results when searching the Text and HTML views. The "Regexp Tester" view only works for text responses. It shows the plain text in the upper panel. The "Test" button allows the user to apply the Regular Expression to the upper panel and the results will be displayed in the lower panel. For example, the RE (JMeter\w*).* applied to the current JMeter home page gives the following output:
Match count: 26 Match[1][0]=JMeter - Apache JMeter</title> Match[1][1]=JMeter Match[2][0]=JMeter" title="JMeter" border="0"/></a> Match[2][1]=JMeter Match[3][0]=JMeterCommitters">Contributors</a> Match[3][1]=JMeterCommitters ... and so on ...

The first number in [] is the match number; the second number is the group. Group [0] is whatever matched the whole RE. Group [1] is whatever matched the 1st group, i.e. (JMeter\w*) in this case. See Figure 9b (below). Control Panel

The Control Panel (above) shows an example of an HTML display. Figure 9 (below) shows an example of an XML display.

Figure 9 Sample XML display

Figure 9a Sample Regexp Test display

18.3.7 Aggregate Report
The aggregate report creates a table row for each differently named request in your test. For each request, it totals the response information and provides request count, min, max, average, error rate, approximate throughput (request/second) and Kilobytes per second throughput. Once the test is done, the throughput is the actual through for the duration of the entire test. The thoughput is calculated from the point of view of the sampler target (e.g. the remote server in the case of HTTP samples). JMeter takes into account the total time over which the requests have been generated. If other samplers and timers are in the same thread, these will increase the total time, and therefore reduce the throughput value. So two identical samplers with different names will have half the throughput of two samplers with the same name. It is important to choose the sampler names correctly to get the best results from the Aggregate Report. Calculation of the Median and 90% Line (90 th percentile ) values requires additional memory. For JMeter 2.3.4 and earlier, details of each sample were saved separately, which meant a lot of memory was needed. JMeter now combines samples with the same elapsed time, so far less memory is used. However, for samples that take more than a few seconds, the probability is that fewer samples will have identical times, in which case more memory will be needed. See the Summary Report for a similar Listener that does not store individual

The time unit is chosen so that the displayed rate is at least 1. Control Panel The figure below shows an example of selecting the "Include group name" checkbox. # Samples .0 requests/minute is saved as 0.samples and so needs constant memory. . (90 th percentile ) Min . it is expressed in requests/second. 30.5.the Throughput is measured in requests per second/minute/hour.The label of the sample. 90% Line .The number of samples with the same label Average . This allows identical labels from different thread groups to be collated separately if required. then the name of the thread group is added as a prefix. If "Include group name in label?" is selected.The longest time for the samples with the same label Error % .The throughput measured in Kilobytes per second Times are in milliseconds.The median is the time in the middle of a set of results. Kb/sec . the remainder took at least as long.The average time of a set of results Median .90% of the samples took no more than this time. When the throughput is saved to a CSV file.The shortest time for the samples with the same label Max . The remaining samples at least as long as this. • • • • • • • • • • Label .Percent of requests with errors Throughput . 50% of the samples took no more than this time.0. i.e.

this visualizer uses a lot of memory.3.Sample "Include group name" display 18.8 View Results in Table This visualizer creates a row for every sample result. Like the View Results Tree . Control Panel .

The fields to save are defined by JMeter properties. The monitor requires Tomcat 5 or above.3. Currently. It is meant to provide an efficient means of recording data by eliminating GUI overhead. please refer to Building a Monitor Test Plan Control Panel . A quick benchmark of memory usage indicates a buffer of 1000 data points for 100 servers would take roughly 10Mb of RAM. There are two primary tabs for the monitor. the monitor should be able to handle several hundred servers.4Ghz centrino laptop with 1Gb of ram.18. The first is the "Health" tab. The equations used for the load calculation is included in the Visualizer. See the jmeter. Use a browser to check that you can access the Tomcat status servlet OK. which will show the status of one or more servers. As a general rule. With a buffer of 1000 data points at 5 second intervals. but any servlet container can port the status servlet and use this monitor. When running in non-GUI mode. Intervals shorter than 5 seconds are too aggressive and have a potential of impacting the server.10 Monitor Results Monitor Results is a new Visualizer for displaying server status. the -l flag can be used to create a data file. This means the buffer shows the performance history of each machine for the last hour.properties file for details. For a detailed description of how to use the monitor. It is designed for Tomcat 5. the primary limitation of the monitor is system memory. monitoring production systems should take care to set an appropriate interval.9 Simple Data Writer This listener can record results to a file but not to the UI.3. The second tab labled "Performance" shows the performance for one server for the last 1000 samples. On a 1. the monitor would check the server status 12 times a minute or 720 times a hour. Control Panel 18.

the threshold lines may be beyond the width of the graph. Control Panel . The same is true of 90% line. If your test plan produces distribution graphs with no apparent clumping or pattern.currentTimeMillis() is 10 milliseconds. The graph will draw two threshold lines: 50% and 90%. the 90% threshold should be within the width of the graph.3. In those situations. Several tests with Tomcat were performed using 30 threads for 600K requests. What this means is 50% of the response times finished between 0 and the line.11 Distribution Graph (alpha) The distribution graph will display a bar for every unique response time.18. The graph was able to display the distribution without any problems and both the 50% and 90% line were within the width of the graph. A performant application will generally produce results that clump together. Since the granularity of System. A poorly written application that has memory leaks may result in wild fluctuations. The only way to know for sure is to use a profiling tool. it may indicate a memory leak. The recommended solution to this specific problem is fix the webapp so it performs well.

By default. Control Panel .18.3. the aggregate graph will generate a bar chart 450 x 250 pixels.12 Aggregate Graph The aggregate graph is similar to the aggregate report. The primary difference is the aggregate graph provides an easy way to generate bar graphs and save the graph as a PNG file.

3. Control Panel .13 Mailer Visualizer The mailer visualizer can be set up to send email if a test run receives too many failed responses from the server.18.

Success Limit The mailer will thus only send out messages in a sequence of failed-succeeded-failed-succeeded. Email subject line for success messages. Email subject line for fail messages. set the count to 0 to send an e-mail on the first failure. etc.Parameters Attribute Name From SMTP Host Failure Subject Success Subject Failure Limit Description Descriptive name for this element that is shown in the tree. Once this number of failed responses is exceeded. Email address to send messages from. Required No Yes Yes No No No Addressee(s) Email address to send messages to. comma-separated. . IP address or host name of SMTP (email redirector) server. a success email is sent.i. a failure email is Yes sent . Yes No No Once this number of successful responses is exceeded after previously reaching the failure limit .e. Test Mail Failures Press this button to send a test mail A field that keeps a running total of number of failures so far received.

Sign up to vote on this title
UsefulNot useful