{"id":32377,"date":"2014-11-03T16:00:24","date_gmt":"2014-11-03T14:00:24","guid":{"rendered":"http:\/\/www.javacodegeeks.com\/?p=32377"},"modified":"2023-12-05T16:04:42","modified_gmt":"2023-12-05T14:04:42","slug":"jmeter-tutorial-load-testing","status":"publish","type":"post","link":"https:\/\/www.javacodegeeks.com\/2014\/11\/jmeter-tutorial-load-testing.html","title":{"rendered":"JMeter Tutorial for Load Testing &#8211; The ULTIMATE Guide (PDF Download)"},"content":{"rendered":"<p>This tutorial is about JMeter.<br \/>\nThese are the main points that we are going to cover:<\/p>\n<ul>\n<li>We are going to explain what is JMeter used for.<\/li>\n<li>How is JMeter implemented and with what technologies is designed.<\/li>\n<li>How to install and configure it properly.<\/li>\n<li>We are going to explain the basic features of its user interface.<\/li>\n<li>We will detailed explain how to configure different test plans.<\/li>\n<li>To show how to analyze its results.<\/li>\n<li>Finally we will mention some important best practices.<\/li>\n<\/ul>\n<p>All examples have been configured and implemented using Java 8 update 0.20, Eclipse Luna 4.4, JMeter 2.11 and MySQL Community Server 5.6.21.<\/p>\n<div class=\"toc\">\n<h3>Table Of Contents<\/h3>\n<dl>\n<dt><a href=\"#introduction\">1. Introduction<\/a><\/dt>\n<dt><a href=\"#Technologies used\">2. Technologies used<\/a><\/dt>\n<dt><a href=\"#What is this article about?\">3. What is this article about?<\/a><\/dt>\n<dt><a href=\"#Installation\">4. Installation<\/a><\/dt>\n<dt><a href=\"#GUI overview\">5. GUI overview<\/a><\/dt>\n<dt><a href=\"#Available requests\">6. Available requests<\/a><\/dt>\n<dt><a href=\"#Test plans and components\">7. Test plans and components<\/a><\/dt>\n<dd>\n<dl>\n<dt><a href=\"#ThreadGroup\">7.1. A Subsection<\/a><\/dt>\n<dt><a href=\"#TSamplers\">7.2. Samplers<\/a><\/dt>\n<dt><a href=\"#Logic controllers\">7.3. Logic controllers<\/a><\/dt>\n<dt><a href=\"#Listeners\">7.4. Listeners<\/a><\/dt>\n<dt><a href=\"#Timers\">7.5. Timers<\/a><\/dt>\n<dt><a href=\"#Assertions\">7.6. Assertions<\/a><\/dt>\n<dt><a href=\"#Configuration nodes\">7.7. Configuration nodes<\/a><\/dt>\n<dt><a href=\"#Pre processors\">7.8. Pre processors<\/a><\/dt>\n<dt><a href=\"#Post processors\">7.9. Post processors<\/a><\/dt>\n<\/dl>\n<\/dd>\n<dt><a href=\"#Test plan elements order of execution\">8. Test plan elements order of execution<\/a><\/dt>\n<dt><a href=\"# Run\/Stop test plans\">9. Run\/Stop test plans<\/a><\/dt>\n<dt><a href=\"# Web (HTTP) test plan\">10. Web (HTTP) test plan<\/a><\/dt>\n<dt><a href=\"# mysql\">11. Database test plan tutorial<\/a><\/dt>\n<dt><a href=\"# junit\">12. Junit test plan<\/a><\/dt>\n<dt><a href=\"# recording\">13. Recording HTTP tests<\/a><\/dt>\n<dt><a href=\"# plugins\">14. JMeter Plugins<\/a><\/dt>\n<dt><a href=\"# best_practices\">15. JMeter best practices<\/a><\/dt>\n<dt><a href=\"# Summary\">16. Summary<\/a><\/dt>\n<dt><a href=\"# download\">17. Download<\/a><\/dt>\n<dt><a href=\"# resources\">18. Resources<\/a><\/dt>\n<\/dl>\n<\/div>\n<h2><a name=\"introduction\"><\/a>1. Introduction<\/h2>\n<p><a href=\"http:\/\/jmeter.apache.org\/\">JMeter<\/a> is an application that offers several possibilities to configure and execute load, performance and stress tests using different technologies and protocols.<\/p>\n<p>It allows simulating different type of requests against all kind of databases, FTP, HTTP, HTTPS or other kind of servers.<\/p>\n<p>It is probably good to explain briefly what all these concepts mean:<\/p>\n<ul>\n<li><strong>Load tests:<\/strong> These kind of tests take the systems or applications tested to the extremes that they were designed and required for. They are used to measure systems and applications behavior under extreme conditions.<\/li>\n<li><strong>Performance tests:<\/strong> These tests are used to check how the system behaves in terms of performance, that is, how the system responds and how is its stability for a specific workload.<\/li>\n<li><strong>Stress tests:<\/strong> These tests try to break or overwhelm the system by loading more resources and taking its modules outside the limits that were designed.<\/li>\n<\/ul>\n<p>Originally JMeter was designed to test web applications, but its functionality has expanded and nowadays allows testing against almost any kind of program and can be used to perform functional tests in your applications.<\/p>\n<h2><a name=\"Technologies used\"><\/a>2. Technologies used<\/h2>\n<p>JMeter is a Java desktop application. Its UI is implemented using the Swing Java API. Due to these two points, JMeter is multiplatform and runs in any kind of machine with a Java virtual machine installed: Windows, Linux, Mac.<\/p>\n<p>Its framework allows concurrency and the execution of several Threads and Threads Groups. This is very useful when trying to configure load and stress tests.<\/p>\n<p>It is extensible and there is a very large list of plugins available.<\/p>\n<p>JMeter is part of the Apache software foundation and is completely free and open source (<a href=\"http:\/\/www.apache.org\/licenses\/\">http:\/\/www.apache.org\/licenses\/<\/a>).<\/p>\n<h2><a name=\"What is this article about?\"><\/a>3. What is this article about?<\/h2>\n<p>This article is a tutorial about how to use JMeter for developers and software engineers without experience on JMeter.<\/p>\n<p>It also provides examples and how-tos about different possible configurations and test plans. In the next chapters we are going to see how to install JMeter and how to configure, run, store and analyze the results of different kind of test plans.<\/p>\n<h2><a name=\"Installation\"><\/a>4. Installation<\/h2>\n<p>You need to do the following steps in order to get JMeter installed and running in your computer:<\/p>\n<ul>\n<li>First of all you have to install Java. You need a JRE 1.6 or above installed in your machine. To do this, just go to the Oracle download site and install the package suitable for your system: <a href=\"http:\/\/www.oracle.com\/technetwork\/java\/javase\/downloads\/index.html\">http:\/\/www.oracle.com\/technetwork\/java\/javase\/downloads\/index.html<\/a>.<\/li>\n<li>Set the <code>JAVA_HOME<\/code> environment variable to point to the base directory location, where Java is installed on your machine. For Windows users:<\/li>\n<\/ul>\n<div>\n<div id=\"highlighter_31545\" class=\"syntaxhighlighter  bash\">\n<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n<tbody>\n<tr>\n<td class=\"gutter\">\n<div class=\"line number1 index0 alt2\">1<\/div>\n<\/td>\n<td class=\"code\">\n<div class=\"container\">\n<div class=\"line number1 index0 alt2\"><code class=\"bash plain\">JAVA_HOME=C:\\Program Files\\Java\\jdk1.8.0_20<\/code><\/div>\n<\/div>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p>or whatever your Java version is.<\/p>\n<ul>\n<li>Append Java compiler location to System Path. For Windows users:<\/li>\n<\/ul>\n<div>\n<div id=\"highlighter_63961\" class=\"syntaxhighlighter  bash\">\n<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n<tbody>\n<tr>\n<td class=\"gutter\">\n<div class=\"line number1 index0 alt2\">1<\/div>\n<\/td>\n<td class=\"code\">\n<div class=\"container\">\n<div class=\"line number1 index0 alt2\"><code class=\"bash plain\">C:\\Program Files\\Java\\jdk1.7.0_25\\bin<\/code><\/div>\n<\/div>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p>to the end of the system variable, Path.<\/p>\n<ul>\n<li>Check that Java is installed in your machine by going to the command line and typing<\/li>\n<\/ul>\n<div>\n<div id=\"highlighter_352568\" class=\"syntaxhighlighter  bash\">\n<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n<tbody>\n<tr>\n<td class=\"gutter\">\n<div class=\"line number1 index0 alt2\">1<\/div>\n<\/td>\n<td class=\"code\">\n<div class=\"container\">\n<div class=\"line number1 index0 alt2\"><code class=\"bash plain\">java -version<\/code><\/div>\n<\/div>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p>Something like the following should come out:<\/p>\n<div>\n<div id=\"highlighter_845195\" class=\"syntaxhighlighter  bash\">\n<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n<tbody>\n<tr>\n<td class=\"gutter\">\n<div class=\"line number1 index0 alt2\">1<\/div>\n<div class=\"line number2 index1 alt1\">2<\/div>\n<div class=\"line number3 index2 alt2\">3<\/div>\n<\/td>\n<td class=\"code\">\n<div class=\"container\">\n<div class=\"line number1 index0 alt2\"><code class=\"bash plain\">java version <\/code><code class=\"bash string\">\"1.8.0_20\"<\/code><\/div>\n<div class=\"line number2 index1 alt1\"><code class=\"bash plain\">Java(TM) SE Runtime Environment (build 1.8.0_20-b26)<\/code><\/div>\n<div class=\"line number3 index2 alt2\"><code class=\"bash plain\">Java HotSpot(TM) 64-Bit Server VM (build 25.20-b23, mixed mode)<\/code><\/div>\n<\/div>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<ul>\n<li>Download the latest version of JMeter from <a href=\"http:\/\/jmeter.apache.org\/download_jmeter.cgi\">http:\/\/jmeter.apache.org\/download_jmeter.cgi<\/a><\/li>\n<li>Extract it to the folder <code>C:\\&gt;JMeter<\/code> for example (in Windows).<\/li>\n<li>The structure of this folder should be something like:<\/li>\n<\/ul>\n<div>\n<div id=\"highlighter_981356\" class=\"syntaxhighlighter  bash\">\n<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n<tbody>\n<tr>\n<td class=\"gutter\">\n<div class=\"line number1 index0 alt2\">01<\/div>\n<div class=\"line number2 index1 alt1\">02<\/div>\n<div class=\"line number3 index2 alt2\">03<\/div>\n<div class=\"line number4 index3 alt1\">04<\/div>\n<div class=\"line number5 index4 alt2\">05<\/div>\n<div class=\"line number6 index5 alt1\">06<\/div>\n<div class=\"line number7 index6 alt2\">07<\/div>\n<div class=\"line number8 index7 alt1\">08<\/div>\n<div class=\"line number9 index8 alt2\">09<\/div>\n<div class=\"line number10 index9 alt1\">10<\/div>\n<div class=\"line number11 index10 alt2\">11<\/div>\n<div class=\"line number12 index11 alt1\">12<\/div>\n<div class=\"line number13 index12 alt2\">13<\/div>\n<div class=\"line number14 index13 alt1\">14<\/div>\n<div class=\"line number15 index14 alt2\">15<\/div>\n<\/td>\n<td class=\"code\">\n<div class=\"container\">\n<div class=\"line number1 index0 alt2\"><code class=\"bash plain\">apache-jmeter-2.9<\/code><\/div>\n<div class=\"line number2 index1 alt1\"><\/div>\n<div class=\"line number3 index2 alt2\"><code class=\"bash plain\">apache-jmeter-2.9\\bin<\/code><\/div>\n<div class=\"line number4 index3 alt1\"><\/div>\n<div class=\"line number5 index4 alt2\"><code class=\"bash plain\">apache-jmeter-2.9\\docs<\/code><\/div>\n<div class=\"line number6 index5 alt1\"><\/div>\n<div class=\"line number7 index6 alt2\"><code class=\"bash plain\">apache-jmeter-2.9\\extras<\/code><\/div>\n<div class=\"line number8 index7 alt1\"><\/div>\n<div class=\"line number9 index8 alt2\"><code class=\"bash plain\">apache-jmeter-2.9\\lib\\<\/code><\/div>\n<div class=\"line number10 index9 alt1\"><\/div>\n<div class=\"line number11 index10 alt2\"><code class=\"bash plain\">apache-jmeter-2.9\\lib\\ext<\/code><\/div>\n<div class=\"line number12 index11 alt1\"><\/div>\n<div class=\"line number13 index12 alt2\"><code class=\"bash plain\">apache-jmeter-2.9\\lib\\junit<\/code><\/div>\n<div class=\"line number14 index13 alt1\"><\/div>\n<div class=\"line number15 index14 alt2\"><code class=\"bash plain\">apache-jmeter-2.9\\printable_docs<\/code><\/div>\n<\/div>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<ul>\n<li>Then you can start JMeter by going to the folder <code>C:\\jmeter\\apache-jmeter-2.11\\bin<\/code> (Windows users) and starting the program <code>jmeter.bat<\/code>.<\/li>\n<li>You should see the start screen of the JMeter GUI:<\/li>\n<\/ul>\n<p><a href=\"http:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2015\/01\/main-screen.jpg\"><img decoding=\"async\" class=\"aligncenter wp-image-35601\" src=\"http:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2015\/01\/main-screen.jpg\" alt=\"JMeter main screen\" width=\"860\" height=\"424\" srcset=\"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2015\/01\/main-screen.jpg 1575w, https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2015\/01\/main-screen-300x148.jpg 300w, https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2015\/01\/main-screen-1024x505.jpg 1024w\" sizes=\"(max-width: 860px) 100vw, 860px\" \/><\/a><\/p>\n<h2><a name=\"GUI overview\"><\/a>5. GUI overview<\/h2>\n<p>The JMeter GUI is very intuitive and easy to use, common menus for file handling like new, open, save, save as etc. and specific menus for starting and stopping test plans and configuring them are available. Every test plan, thread group and test plan node (we will see these more in detail in the next chapters) offer different context menu options by clicking the mouse right button.<\/p>\n<p>It is also possible to change the language of the UI and a big bunch of languages are available.<\/p>\n<p>As we said, the GUI is very intuitive and easy to use and offers for every menu and action very understandable tool tips. This is one of the reasons, apart from its quality, why JMeter is so broadly used, because it is really easy to understand and learn how to work with it.<\/p>\n<h2><a name=\"Available requests\"><\/a>6. Available requests<\/h2>\n<p>JMeter offers test configurations for almost any kind of system, but in general, following protocols are covered out of the box:<\/p>\n<ul>\n<li>Web: HTTP, HTTPS sites &#8216;web 1.0&#8217; web 2.0 (ajax, flex and flex-ws-amf): we will see afterwards how to test a potential web page and its behavior.<\/li>\n<li>Web Services: SOAP \/ XML-RPC.<\/li>\n<li>Database via JDBC drivers. Almost any kind of database is supported, what you need is just a proper driver and pack it in the proper folder in the JMeter installation directory. We will make an example of a MySQL database test afterwards.<\/li>\n<li>Directory: LDAP.<\/li>\n<li>Messaging Oriented service via JMS<\/li>\n<li>Mail Service using POP3, IMAP, SMTP.<\/li>\n<li>FTP Service.<\/li>\n<li>Functional test using JUnit and Java applications.<\/li>\n<\/ul>\n<h2><a name=\"Test plans and components\"><\/a>7. Test plans and components<\/h2>\n<p>Basically, using JMeter consists of the creation, configuration and execution of test plans and the analysis of their results. Test plans are sets of requests against local or remote servers (or clients) configured to run by following specific instructions.<\/p>\n<p>In the configuration of a test plan you can specify several input and output parameters and you can configure the basic conditions that should be met so the test plan is successful or not.<\/p>\n<p>JMeter test plans are composed of different components. Here is a list of the most important ones with instructions about how you can add them using the JMeter UI and what their purpose is:<\/p>\n<h3><a name=\"ThreadGroup\"><\/a>7.1 ThreadGroup<\/h3>\n<p>A thread group is basically a combination of different test plan elements. It is the root of a test plan and it controls the basic central parameters.<\/p>\n<p>In order to create a test plan you may have to create at first a thread group and configure its number of threads, the ramp-up period, the loop counts and the behavior in case or error:<\/p>\n<ul>\n<li><strong>Number of threads:<\/strong> The number of threads that are going to be used to execute the test plan, very important to configure load and stress tests.<\/li>\n<li><strong>Ramp-up period:<\/strong> Time that JMeter will need to start all threads.<\/li>\n<li><strong>Loop count:<\/strong> Number of iterations, that is the amount of times that the test is going to be executed.<\/li>\n<li><strong>Error behavior:<\/strong> What to do in case of error: Stop current thread, stop the whole test, continue&#8230;<\/li>\n<\/ul>\n<p>A Thread Group has also the start and end time configuration options. By clicking the checkbox &#8220;Scheduler&#8221; a new section with the schedule parameters will appear and you can configure the start and end time of your test.<\/p>\n<p>Once this is configured you can start adding other test plan elements to your Thread group like samplers, listener and timers. We are going to explain all these in the next chapters.<\/p>\n<h3><a name=\"Samplers\"><\/a>7.2 Samplers<\/h3>\n<p>Samplers are used for sending requests to different kind of servers. They are the basic element of every test plan and everything works around them: they execute requests (based on the configuration provided) and these requests produce one or more responses that are analyzed afterwards.<br \/>\nHere is a list of the Samplers available in JMeter (we are going to see some of them in this tutorial):<\/p>\n<ul>\n<li>Access log sampler<\/li>\n<li>AJP sampler<\/li>\n<li>Bean shell sampler<\/li>\n<li>BSF sampler<\/li>\n<li>Debug sampler<\/li>\n<li>FTP sampler<\/li>\n<li>HTTP sampler<\/li>\n<li>Java sampler<\/li>\n<li>JDBC sampler<\/li>\n<li>JMS (several) samplers<\/li>\n<li>JSR223 sampler<\/li>\n<li>JUnit sampler<\/li>\n<li>LDAP (several) samplers<\/li>\n<li>Mail Reader<\/li>\n<li>MongoDB sampler<\/li>\n<li>OS process sampler<\/li>\n<li>SMTP sampler<\/li>\n<li>SOAP<\/li>\n<li>TCP samplers<\/li>\n<li>Test action<\/li>\n<\/ul>\n<p>As we can see in the list above, there are a lot of different types of samplers; this list is not complete since there are several samplers implemented in different JMeter plugins. The configuration of each sampler depends on the request that it executes, that means that some samplers have things in common but others are completely different because of the nature of their requests.<\/p>\n<h3><a name=\"Logic controllers\"><\/a>7.3 Logic controllers<\/h3>\n<p>Logic controllers are elements that allow you to configure the order of execution of different samplers inside a Thread group. This list contains all available logic controllers in JMeter:<\/p>\n<ul>\n<li>Simple Controller<\/li>\n<li>Loop Controller<\/li>\n<li>Once Only Controller<\/li>\n<li>Interleave Controller<\/li>\n<li>Random Controller<\/li>\n<li>Random Order Controller<\/li>\n<li>Throughput Controller<\/li>\n<li>Runtime Controller<\/li>\n<li>If Controller<\/li>\n<li>While Controller<\/li>\n<li>Switch Controller<\/li>\n<li>ForEach Controller<\/li>\n<li>Module Controller<\/li>\n<li>Include Controller<\/li>\n<li>Transaction Controller<\/li>\n<li>Recording Controller<\/li>\n<\/ul>\n<h3><a name=\"Listeners\"><\/a>7.4 Listeners<\/h3>\n<p>Listeners provide different ways to view the results produced by a Sampler requests. Listeners parse results in form of tables, trees or plain log files.<\/p>\n<p>They can be added anywhere in a test plan, but they will only parse and collect result data from the samplers at their level or in the levels bellow.<\/p>\n<p>These are the available listeners in JMeter:<\/p>\n<ul>\n<li>Sample Result Save Configuration<\/li>\n<li>Graph Full Results<\/li>\n<li>Graph Results<\/li>\n<li>Spline Visualizer<\/li>\n<li>Assertion Results<\/li>\n<li>View Results Tree<\/li>\n<li>Aggregate Report<\/li>\n<li>View Results in Table<\/li>\n<li>Simple Data Writer<\/li>\n<li>Monitor Results<\/li>\n<li>Distribution Graph (alpha)<\/li>\n<li>Aggregate Graph<\/li>\n<li>Mailer Visualizer<\/li>\n<li>BeanShell Listener<\/li>\n<li>Summary Report<\/li>\n<\/ul>\n<h3><a name=\"Timers\"><\/a>7.5 Timers<\/h3>\n<p>You can define the time period that you want to wait between requests using timers. If you do not specify any, JMeter will execute the next request immediately after the current one is finished, without any waiting time.<\/p>\n<p>Following timers are available in JMeter:<div style=\"display:inline-block; margin: 15px 0;\"> <div id=\"adngin-JavaCodeGeeks_incontent_video-0\" style=\"display:inline-block;\"><\/div> <\/div><\/p>\n<ul>\n<li>Constant Timer<\/li>\n<li>Gaussian Random Timer<\/li>\n<li>Uniform Random Timer<\/li>\n<li>Constant Throughput Timer<\/li>\n<li>Synchronizing Timer<\/li>\n<li>JSR223 Time<\/li>\n<li>BeanShell Time<\/li>\n<li>BSF Time<\/li>\n<li>Poisson Random Time<\/li>\n<\/ul>\n<h3><a name=\"Assertions\"><\/a>7.6 Assertions<\/h3>\n<p>Assertions confirm the validity of the test plan by validating the response produced by a Sampler request. Basically assertions are similar to unit test assertions and check the quality of the tested application response. You can configure what kind of assertions is active for every test plan.<\/p>\n<p>Here is a list of available assertions in JMeter:<\/p>\n<ul>\n<li>Bean shell Assertion<\/li>\n<li>BSF Assertion<\/li>\n<li>Compare Assertion<\/li>\n<li>JSR223 Assertion<\/li>\n<li>Response Assertion<\/li>\n<li>Duration Assertion<\/li>\n<li>Size Assertion<\/li>\n<li>XML Assertion<\/li>\n<li>BeanShell Assertion<\/li>\n<li>MD5Hex Assertion<\/li>\n<li>HTML Assertion<\/li>\n<li>XPath Assertion<\/li>\n<li>XML Schema Assertion<\/li>\n<\/ul>\n<h3><a name=\"Configuration nodes\"><\/a>7.7 Configuration nodes<\/h3>\n<p>You can pass different parameters to the sampler requests by using configuration elements. They provide a way to create variables (different and dynamically) that can be used by the samplers afterwards. They are executed at the beginning of the node they belong to, before the samplers are executed, that is why the samplers can rely on these variables.<\/p>\n<p>Here is a list of all the configuration nodes that can be used in JMeter:<\/p>\n<ul>\n<li>Counter<\/li>\n<li>CSV Data Set Config<\/li>\n<li>FTP Request Defaults<\/li>\n<li>HTTP Authorization Manager<\/li>\n<li>HTTP Cache Manager<\/li>\n<li>HTTP Cookie Manager<\/li>\n<li>HTTP Proxy Server<\/li>\n<li>HTTP Request Defaults<\/li>\n<li>HTTP Header Manager<\/li>\n<li>Java Request Defaults<\/li>\n<li>Keystore Configuration<\/li>\n<li>JDBC Connection Configuration<\/li>\n<li>Login Config Element<\/li>\n<li>LDAP Request Defaults<\/li>\n<li>LDAP Extended Request Defaults<\/li>\n<li>TCP Sampler Config<\/li>\n<li>User Defined Variables<\/li>\n<li>Simple Config Element<\/li>\n<li>Random Variable<\/li>\n<\/ul>\n<h3><a name=\"Pre processors\"><\/a>7.8 Pre processors<\/h3>\n<p>Pre processors are elements (actions, assertions or basically whatever) that is going to happen before a sampler is executed. They can be used to extract variables from a response that can be used in the sampler afterwards via configuration elements.<\/p>\n<p>These are the elements that can be used as pre processors:<\/p>\n<ul>\n<li>HTML Link Parser<\/li>\n<li>HTTP URL Re-writing Modifier<\/li>\n<li>HTTP User Parameter Modifier<\/li>\n<li>User Parameters<\/li>\n<li>JDBC PreProcessor<\/li>\n<li>JSR223 PreProcessor<\/li>\n<li>RegEx User Parameters<\/li>\n<li>BeanShell PreProcessor<\/li>\n<li>BSF PreProcessor<\/li>\n<\/ul>\n<h3><a name=\"Post processors\"><\/a>7.9 Post processors<\/h3>\n<p>Is basically an element that is executed after a sampler execution finishes. It can be used to parse the response data and extract values that can be used afterwards.<\/p>\n<p>These elements can be used as post processors:<\/p>\n<ul>\n<li>Regular Expression Extractor<\/li>\n<li>XPath Extractor<\/li>\n<li>Result Status Action Handler<\/li>\n<li>JSR223 PostProcessor<\/li>\n<li>JDBC PostProcessor<\/li>\n<li>BSF PostProcessor<\/li>\n<li>CSS\/JQuery Extractor<\/li>\n<li>BeanShell PostProcessor<\/li>\n<li>Debug PostProcessor<\/li>\n<\/ul>\n<h2><a name=\"Test plan elements order of execution\"><\/a>8. Test plan elements order of execution<\/h2>\n<p>A test plan elements are ordered and executed always in the following way:<\/p>\n<p>1 &#8211; Configuration nodes<br \/>\n2 &#8211; Pre processors<br \/>\n3 &#8211; Timers<br \/>\n4 &#8211; Sampler<br \/>\n5 &#8211; Post processors (only executed if there are results available)<br \/>\n6 &#8211; Assertions (only executed if there are results available)<br \/>\n7 &#8211; Listeners (only executed if there are results available)<\/p>\n<p>It is good to mention that a test plan can contain one or more test plans inside it and that this is a common practice to group tests by functional or technical logic together.<\/p>\n<h2><a name=\" Run\/Stop test plans\"><\/a>9. Run\/Stop test plans<\/h2>\n<p>To run a test plan you just need to click in the <code>\"Play\"<\/code> button:<\/p>\n<p><a href=\"http:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2015\/01\/start.png\"><img decoding=\"async\" class=\"aligncenter wp-image-35603\" src=\"http:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2015\/01\/start.png\" alt=\"JMeter start\" width=\"860\" height=\"400\" srcset=\"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2015\/01\/start.png 1356w, https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2015\/01\/start-300x140.png 300w, https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2015\/01\/start-1024x477.png 1024w\" sizes=\"(max-width: 860px) 100vw, 860px\" \/><\/a><\/p>\n<p>It is possible to start a test and ignore all the pauses by clicking in the button <code>\"Play no pauses\"<\/code><\/p>\n<p><a href=\"http:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2015\/01\/start-no-pauses.png\"><img decoding=\"async\" class=\"aligncenter wp-image-35605\" src=\"http:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2015\/01\/start-no-pauses.png\" alt=\"JMeter start no pauses\" width=\"860\" height=\"392\" srcset=\"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2015\/01\/start-no-pauses.png 1378w, https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2015\/01\/start-no-pauses-300x137.png 300w, https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2015\/01\/start-no-pauses-1024x467.png 1024w\" sizes=\"(max-width: 860px) 100vw, 860px\" \/><\/a><\/p>\n<p>You can stop the test by clicking in the <code>\"Stop\"<\/code> button:<\/p>\n<p><a href=\"http:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2015\/01\/stop.png\"><img decoding=\"async\" class=\"aligncenter wp-image-35606\" src=\"http:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2015\/01\/stop.png\" alt=\"JMeter stop\" width=\"860\" height=\"401\" srcset=\"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2015\/01\/stop.png 1352w, https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2015\/01\/stop-300x140.png 300w, https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2015\/01\/stop-1024x477.png 1024w\" sizes=\"(max-width: 860px) 100vw, 860px\" \/><\/a><\/p>\n<p>It is also possible to disable test plans for execution. To do this you just need to &#8220;toogle&#8221; the status of the test plan:<\/p>\n<p><a href=\"http:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2015\/01\/enable-disable-test-plan.png\"><img decoding=\"async\" class=\"aligncenter wp-image-35607 size-full\" src=\"http:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2015\/01\/enable-disable-test-plan.png\" alt=\"JMeter enable disable test plan\" width=\"465\" height=\"491\" srcset=\"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2015\/01\/enable-disable-test-plan.png 465w, https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2015\/01\/enable-disable-test-plan-284x300.png 284w\" sizes=\"(max-width: 465px) 100vw, 465px\" \/><\/a><br \/>\nAs you can see in the screen capture above, the disabled plans are rendered with grey color and they cannot be executed but they can be modified or reconfigured.<\/p>\n<h2><a name=\" Web (HTTP) test plan\"><\/a>10. Web (HTTP) test plan<\/h2>\n<p>In this chapter we are going to see how to create a plan to test an specific web page via HTTP. For that purpose i will use the <a href=\"http:\/\/www.wikipedia.org\">http:\/\/www.wikipedia.org<\/a> site.<\/p>\n<p>So enough theory, now we are going to see how to configure an HTTP request test plan.<\/p>\n<ul>\n<li>Rename Test Plan to the name that you like<\/li>\n<\/ul>\n<p>In this step is possible to configure the test plan in general terms affecting the behavior of Threads and you can add external libraries that should be used. We are not going to do that in this example.<\/p>\n<p><a href=\"http:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2015\/01\/main-test-plan.jpg\"><img decoding=\"async\" class=\"aligncenter wp-image-35608\" src=\"http:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2015\/01\/main-test-plan.jpg\" alt=\"JMeter main test plan\" width=\"860\" height=\"490\" srcset=\"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2015\/01\/main-test-plan.jpg 1069w, https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2015\/01\/main-test-plan-300x171.jpg 300w, https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2015\/01\/main-test-plan-1024x583.jpg 1024w\" sizes=\"(max-width: 860px) 100vw, 860px\" \/><\/a><\/p>\n<ul>\n<li>Add Thread Group<\/li>\n<\/ul>\n<p>In this step you need to create a Thread group in charge of executing all the components of the test and configure its main properties: number of threads, ramp up period in seconds and number of iterations.<\/p>\n<p><strong>Context Menu over Test Plan -&gt; Add -&gt; Thread -&gt;ThreadGroup<\/strong><\/p>\n<p><a href=\"http:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2015\/01\/main-http-test-plan.jpg\"><img decoding=\"async\" class=\"aligncenter wp-image-35609\" src=\"http:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2015\/01\/main-http-test-plan.jpg\" alt=\"JMeter main http test plan\" width=\"860\" height=\"304\" srcset=\"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2015\/01\/main-http-test-plan.jpg 1282w, https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2015\/01\/main-http-test-plan-300x106.jpg 300w, https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2015\/01\/main-http-test-plan-1024x362.jpg 1024w\" sizes=\"(max-width: 860px) 100vw, 860px\" \/><\/a><\/p>\n<p>you can also specify the action you want to take in case of error (continue, stop, stop current Thread&#8230;)<\/p>\n<ul>\n<li>Add Sampler HTTP Request<\/li>\n<\/ul>\n<p>In this step we add the sampler with the information of the HTTP Request that we want to test:<\/p>\n<p><strong>Add Sampler-&gt;HTTP Request<\/strong><\/p>\n<p>We need to set different properties for this type of request:<\/p>\n<p>Set the server name to the name of the server we want to test: www.wikipedia.org (without the http or https protocol) in this case. You should modify the connection values for port, protocol, method to execute in the server, etc. if needed, if our case this is not necessary. There are several parameters for configuring proxies, timeouts and different header information as well, but in our case, we leave everything with the default values<\/p>\n<p><a href=\"http:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2015\/01\/http-config-sampler.jpg\"><img decoding=\"async\" class=\"aligncenter wp-image-35610\" src=\"http:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2015\/01\/http-config-sampler.jpg\" alt=\"JMeter http config sampler\" width=\"860\" height=\"427\" srcset=\"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2015\/01\/http-config-sampler.jpg 1173w, https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2015\/01\/http-config-sampler-300x149.jpg 300w, https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2015\/01\/http-config-sampler-1024x509.jpg 1024w\" sizes=\"(max-width: 860px) 100vw, 860px\" \/><\/a><\/p>\n<ul>\n<li>Add Results Listener<\/li>\n<\/ul>\n<p>This is needed to be able to see the results afterwards; there are several possibilities as we saw before in this tutorial, for our HTTP Request test plan we are going to use a View Results Tree:<\/p>\n<p><strong>Add Listener -&gt; View Results Tree<\/strong><\/p>\n<p>For our example, we do not change anything there and leave all the configuration properties with the default values.<\/p>\n<p><a href=\"http:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2015\/01\/http-results-empty.jpg\"><img decoding=\"async\" class=\"aligncenter wp-image-35611\" src=\"http:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2015\/01\/http-results-empty.jpg\" alt=\"JMeter http results empty\" width=\"860\" height=\"525\" srcset=\"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2015\/01\/http-results-empty.jpg 1162w, https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2015\/01\/http-results-empty-300x183.jpg 300w, https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2015\/01\/http-results-empty-1024x625.jpg 1024w\" sizes=\"(max-width: 860px) 100vw, 860px\" \/><\/a><\/p>\n<ul>\n<li>Save the test plan and Run it<\/li>\n<\/ul>\n<p><strong>File-&gt;Save<\/strong> (or click &#8220;Control + s&#8221;)<\/p>\n<p><strong>Run-&gt;Start<\/strong> (or click play as explained before)<\/p>\n<ul>\n<li>Check results in the listener<\/li>\n<\/ul>\n<p><a href=\"http:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2015\/01\/http-results-fine.jpg\"><img decoding=\"async\" class=\"aligncenter wp-image-35612\" src=\"http:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2015\/01\/http-results-fine.jpg\" alt=\"JMeter http results fine\" width=\"860\" height=\"501\" srcset=\"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2015\/01\/http-results-fine.jpg 1122w, https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2015\/01\/http-results-fine-300x175.jpg 300w, https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2015\/01\/http-results-fine-1024x596.jpg 1024w\" sizes=\"(max-width: 860px) 100vw, 860px\" \/><\/a><\/p>\n<p>We can see that all the requests have been done as expected and all of them provide meaningful responses, so it seems that the web page that we are testing works fine (if this is the expected behavior). We can play around with the results and check all the returned data.<\/p>\n<p>We have already configured a test plan that sends a bunch or requests to a given server and parses the responses. We are going to see now how to use other type of test components like Timers and Assertions.<\/p>\n<ul>\n<li>Add a timer<\/li>\n<\/ul>\n<p>In order to add a Timer we just right click on the test plan and add a timer:<\/p>\n<p><strong>Add Timer-&gt;Constant Timer<\/strong><\/p>\n<p>and we configure it with 500 miliseconds. Every request will wait 500 ms after the last one is finished.<\/p>\n<p><a href=\"http:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2015\/01\/timer.jpg\"><img decoding=\"async\" class=\"aligncenter wp-image-35613\" src=\"http:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2015\/01\/timer.jpg\" alt=\"JMeter timer\" width=\"860\" height=\"159\" srcset=\"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2015\/01\/timer.jpg 925w, https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2015\/01\/timer-300x55.jpg 300w\" sizes=\"(max-width: 860px) 100vw, 860px\" \/><\/a><\/p>\n<ul>\n<li>Add duration assertion<\/li>\n<\/ul>\n<p>On the test plan, right click and add a duration assertion, we configure it to assert false if the response takes longer than 100 ms, and we configure it for the main sample only:<\/p>\n<p><strong>Add assertion-&gt;Duration assertion<\/strong><\/p>\n<p><a href=\"http:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2015\/01\/duration-assertion-100.jpg\"><img decoding=\"async\" class=\"aligncenter wp-image-35615\" src=\"http:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2015\/01\/duration-assertion-100.jpg\" alt=\"JMeter duration assertion 100\" width=\"860\" height=\"218\" srcset=\"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2015\/01\/duration-assertion-100.jpg 1063w, https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2015\/01\/duration-assertion-100-300x76.jpg 300w, https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2015\/01\/duration-assertion-100-1024x260.jpg 1024w\" sizes=\"(max-width: 860px) 100vw, 860px\" \/><\/a><\/p>\n<p>If we re run the test plan (after saving) we will see that we have some issues with this assertion:<\/p>\n<p><a href=\"http:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2015\/01\/http-results-error-assertion-duration.jpg\"><img decoding=\"async\" class=\"aligncenter wp-image-35616\" src=\"http:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2015\/01\/http-results-error-assertion-duration.jpg\" alt=\"JMeter http results error assertion duration\" width=\"860\" height=\"503\" srcset=\"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2015\/01\/http-results-error-assertion-duration.jpg 1078w, https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2015\/01\/http-results-error-assertion-duration-300x176.jpg 300w, https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2015\/01\/http-results-error-assertion-duration-1024x599.jpg 1024w\" sizes=\"(max-width: 860px) 100vw, 860px\" \/><\/a><\/p>\n<p>Obvioulsy this happens because we configure the duration assertion only with 100 ms, if we change this figure to 2000 ms almost all requests will be served on time.<\/p>\n<ul>\n<li>Add size assertion<\/li>\n<\/ul>\n<p><strong>Add assertion-&gt;Size Assertion <\/strong><\/p>\n<p>and we assure that the response has a size larger than 5000 bytes:<\/p>\n<p><a href=\"http:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2015\/01\/size-assertion-5000.jpg\"><img decoding=\"async\" class=\"aligncenter wp-image-35617\" src=\"http:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2015\/01\/size-assertion-5000.jpg\" alt=\"JMeter size assertion 5000\" width=\"860\" height=\"343\" srcset=\"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2015\/01\/size-assertion-5000.jpg 1122w, https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2015\/01\/size-assertion-5000-300x120.jpg 300w, https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2015\/01\/size-assertion-5000-1024x408.jpg 1024w\" sizes=\"(max-width: 860px) 100vw, 860px\" \/><\/a><\/p>\n<p>If we run the test we will see that the response is always larger than that, in case of an error response the size would be, probably, smaller and our assertion will fail.<br \/>\n[ulp id=&#8217;x6sFG6uPniUdaGxM&#8217;]<br \/>\n&nbsp;<\/p>\n<h2><a name=\" mysql\"><\/a>11. Database test plan tutorial<\/h2>\n<p>Now we are going to see how to configure, run and analyze the results of a test against a MySQL Database. This example is about MySQL but it can be done using any other kind of DB like Oracle, MongoDB or others.<\/p>\n<ul>\n<li>Install MySQL<\/li>\n<\/ul>\n<p>If you do not have MySQL installed in your computer, you can download it from <a href=\"http:\/\/dev.mysql.com\/downloads\/\">http:\/\/dev.mysql.com\/downloads\/<\/a> and install the MySQL server, it is very easy.<\/p>\n<ul>\n<li>Download the MySQL driver<\/li>\n<\/ul>\n<p>Download mysql connector (<code>mysql-connector-java-5.1.6<\/code>) and copy it in the lib directory of jmeter <code>C:\\jmeter\\apache-jmeter-2.11\\lib<\/code>.<\/p>\n<ul>\n<li>Start MySQL<\/li>\n<\/ul>\n<p>Start the DB server so that you can make queries against it.<\/p>\n<ul>\n<li>Create database<\/li>\n<\/ul>\n<p>You can create a database as you want, here is just an example of a very simple one:<\/p>\n<div>\n<div id=\"highlighter_935207\" class=\"syntaxhighlighter  bash\">\n<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n<tbody>\n<tr>\n<td class=\"gutter\">\n<div class=\"line number1 index0 alt2\">01<\/div>\n<div class=\"line number2 index1 alt1\">02<\/div>\n<div class=\"line number3 index2 alt2\">03<\/div>\n<div class=\"line number4 index3 alt1\">04<\/div>\n<div class=\"line number5 index4 alt2\">05<\/div>\n<div class=\"line number6 index5 alt1\">06<\/div>\n<div class=\"line number7 index6 alt2\">07<\/div>\n<div class=\"line number8 index7 alt1\">08<\/div>\n<div class=\"line number9 index8 alt2\">09<\/div>\n<div class=\"line number10 index9 alt1\">10<\/div>\n<div class=\"line number11 index10 alt2\">11<\/div>\n<\/td>\n<td class=\"code\">\n<div class=\"container\">\n<div class=\"line number1 index0 alt2\"><code class=\"bash plain\">create database jmeter;<\/code><\/div>\n<div class=\"line number2 index1 alt1\"><\/div>\n<div class=\"line number3 index2 alt2\"><code class=\"bash plain\">use jmeter;<\/code><\/div>\n<div class=\"line number4 index3 alt1\"><\/div>\n<div class=\"line number5 index4 alt2\"><code class=\"bash plain\">create table jmeter_stuff(<\/code><code class=\"bash functions\">id<\/code> <code class=\"bash plain\">int, name varchar(50), description varchar(50));<\/code><\/div>\n<div class=\"line number6 index5 alt1\"><\/div>\n<div class=\"line number7 index6 alt2\"><code class=\"bash plain\">insert into jmeter_stuff(<\/code><code class=\"bash functions\">id<\/code><code class=\"bash plain\">, name, description)VALUES(1, <\/code><code class=\"bash string\">\"dani\"<\/code><code class=\"bash plain\">, <\/code><code class=\"bash string\">\"the boss\"<\/code><code class=\"bash plain\">);<\/code><\/div>\n<div class=\"line number8 index7 alt1\"><\/div>\n<div class=\"line number9 index8 alt2\"><code class=\"bash plain\">insert into jmeter_stuff(<\/code><code class=\"bash functions\">id<\/code><code class=\"bash plain\">, name, description)VALUES(2, <\/code><code class=\"bash string\">\"topo\"<\/code><code class=\"bash plain\">, <\/code><code class=\"bash string\">\"the worker\"<\/code><code class=\"bash plain\">);<\/code><\/div>\n<div class=\"line number10 index9 alt1\"><\/div>\n<div class=\"line number11 index10 alt2\"><code class=\"bash plain\">insert into jmeter_stuff(<\/code><code class=\"bash functions\">id<\/code><code class=\"bash plain\">, name, description)VALUES(3, <\/code><code class=\"bash string\">\"tupac\"<\/code><code class=\"bash plain\">, <\/code><code class=\"bash string\">\"the other\"<\/code><code class=\"bash plain\">);<\/code><\/div>\n<\/div>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<ul>\n<li>Create a test plan<\/li>\n<\/ul>\n<p>Do the same actions as in the chapter before to create a test Plan using a new Thread Group, a new configuration element of the type JDBC configuration and a new request (sampler) of the type JDBC, add also a listener to parse and view the results in the same way as we did in the example before.<br \/>\nThe only difference is the type of the sampler, in this case JDBC Sampler.<\/p>\n<ul>\n<li>JDBC Sampler<\/li>\n<\/ul>\n<p>Give a meaningful name to the Variable Bound to Pool and write some SQL statement:<\/p>\n<div>\n<div id=\"highlighter_428760\" class=\"syntaxhighlighter  bash\">\n<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n<tbody>\n<tr>\n<td class=\"gutter\">\n<div class=\"line number1 index0 alt2\">1<\/div>\n<\/td>\n<td class=\"code\">\n<div class=\"container\">\n<div class=\"line number1 index0 alt2\"><code class=\"bash functions\">select<\/code> <code class=\"bash plain\">* from jmeter_stuff;<\/code><\/div>\n<\/div>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p><a href=\"http:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2015\/01\/db-request-configuration.jpg\"><img decoding=\"async\" class=\"aligncenter wp-image-35618\" src=\"http:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2015\/01\/db-request-configuration.jpg\" alt=\"JMeter db request configuration\" width=\"860\" height=\"459\" srcset=\"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2015\/01\/db-request-configuration.jpg 1155w, https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2015\/01\/db-request-configuration-300x160.jpg 300w, https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2015\/01\/db-request-configuration-1024x546.jpg 1024w\" sizes=\"(max-width: 860px) 100vw, 860px\" \/><\/a><\/p>\n<ul>\n<li>JDBC Connection configuration<\/li>\n<\/ul>\n<p>Add a new JDBC Connection Configuration to the sampler.<\/p>\n<p><strong>right click on the JDBC sampler -&gt; add connection configuration<\/strong><\/p>\n<p>Change the parameters as follows:<\/p>\n<div>\n<div id=\"highlighter_992384\" class=\"syntaxhighlighter  bash\">\n<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n<tbody>\n<tr>\n<td class=\"gutter\">\n<div class=\"line number1 index0 alt2\">1<\/div>\n<div class=\"line number2 index1 alt1\">2<\/div>\n<div class=\"line number3 index2 alt2\">3<\/div>\n<div class=\"line number4 index3 alt1\">4<\/div>\n<div class=\"line number5 index4 alt2\">5<\/div>\n<div class=\"line number6 index5 alt1\">6<\/div>\n<div class=\"line number7 index6 alt2\">7<\/div>\n<\/td>\n<td class=\"code\">\n<div class=\"container\">\n<div class=\"line number1 index0 alt2\"><code class=\"bash plain\">Variable Bound to Pool= same name as <\/code><code class=\"bash keyword\">in<\/code> <code class=\"bash plain\">the sampler<\/code><\/div>\n<div class=\"line number2 index1 alt1\"><code class=\"bash plain\">Database URl=jdbc:mysql:<\/code><code class=\"bash plain\">\/\/localhost<\/code><code class=\"bash plain\">:3306<\/code><code class=\"bash plain\">\/jmeter<\/code><\/div>\n<div class=\"line number3 index2 alt2\"><code class=\"bash plain\">JDBC Driver class=com.mysql.jdbc.Driver<\/code><\/div>\n<div class=\"line number4 index3 alt1\"><code class=\"bash plain\">username=<\/code><\/div>\n<div class=\"line number5 index4 alt2\"><code class=\"bash plain\">password=<\/code><\/div>\n<div class=\"line number6 index5 alt1\"><\/div>\n<div class=\"line number7 index6 alt2\"><code class=\"bash functions\">set<\/code> <code class=\"bash plain\">username and password to your MySql credentials.<\/code><\/div>\n<\/div>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p><a href=\"http:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2015\/01\/db-connection-configuration.jpg\"><img decoding=\"async\" class=\"aligncenter wp-image-35619\" src=\"http:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2015\/01\/db-connection-configuration.jpg\" alt=\"JMeter db connection configuration\" width=\"860\" height=\"575\" srcset=\"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2015\/01\/db-connection-configuration.jpg 935w, https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2015\/01\/db-connection-configuration-300x201.jpg 300w\" sizes=\"(max-width: 860px) 100vw, 860px\" \/><\/a><\/p>\n<ul>\n<li>Save the plan and execute it.<\/li>\n<li>View the results using the listener configured before.<\/li>\n<\/ul>\n<p>You can verify and check the output in the same way as in the HTTP request test plan, you can also add preprocessors, post processors, assertions or any other kind of element that you may need.<\/p>\n<p><a href=\"http:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2014\/10\/db-results-response-data.jpg\"><br \/>\n<\/a><a href=\"http:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2015\/01\/db-results-response-data.jpg\"><img decoding=\"async\" class=\"aligncenter wp-image-35620 size-full\" src=\"http:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2015\/01\/db-results-response-data.jpg\" alt=\"JMeter db results response data\" width=\"840\" height=\"548\" srcset=\"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2015\/01\/db-results-response-data.jpg 840w, https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2015\/01\/db-results-response-data-300x196.jpg 300w\" sizes=\"(max-width: 840px) 100vw, 840px\" \/><\/a><\/p>\n<p>In this case the output is the results of the select statement.<\/p>\n<p>You can use this kind of samplers for updating data as well by changing the SQL statement in the sampler configuration.<\/p>\n<p>In the following screen capture is the basic information about the request response results:<\/p>\n<p><a href=\"http:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2015\/01\/db-results-response.jpg\"><img decoding=\"async\" class=\"aligncenter wp-image-35621 size-full\" src=\"http:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2015\/01\/db-results-response.jpg\" alt=\"JMeter db results response\" width=\"853\" height=\"559\" srcset=\"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2015\/01\/db-results-response.jpg 853w, https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2015\/01\/db-results-response-300x197.jpg 300w\" sizes=\"(max-width: 853px) 100vw, 853px\" \/><\/a><\/p>\n<h2><a name=\" junit\"><\/a>12. Junit test plan<\/h2>\n<p>In this chapter we are going to explain how to use JMeter in combination with JUnit. This provides very strong mechanisms for executing functional tests from a load and performance point of view.<\/p>\n<ul>\n<li>First of all you need to create a Junit test like the following one:<\/li>\n<\/ul>\n<div>\n<div id=\"highlighter_105258\" class=\"syntaxhighlighter  java\">\n<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n<tbody>\n<tr>\n<td class=\"gutter\">\n<div class=\"line number1 index0 alt2\">01<\/div>\n<div class=\"line number2 index1 alt1\">02<\/div>\n<div class=\"line number3 index2 alt2\">03<\/div>\n<div class=\"line number4 index3 alt1\">04<\/div>\n<div class=\"line number5 index4 alt2\">05<\/div>\n<div class=\"line number6 index5 alt1\">06<\/div>\n<div class=\"line number7 index6 alt2\">07<\/div>\n<div class=\"line number8 index7 alt1\">08<\/div>\n<div class=\"line number9 index8 alt2\">09<\/div>\n<div class=\"line number10 index9 alt1\">10<\/div>\n<div class=\"line number11 index10 alt2\">11<\/div>\n<div class=\"line number12 index11 alt1\">12<\/div>\n<div class=\"line number13 index12 alt2\">13<\/div>\n<div class=\"line number14 index13 alt1\">14<\/div>\n<div class=\"line number15 index14 alt2\">15<\/div>\n<div class=\"line number16 index15 alt1\">16<\/div>\n<div class=\"line number17 index16 alt2\">17<\/div>\n<div class=\"line number18 index17 alt1\">18<\/div>\n<div class=\"line number19 index18 alt2\">19<\/div>\n<div class=\"line number20 index19 alt1\">20<\/div>\n<div class=\"line number21 index20 alt2\">21<\/div>\n<div class=\"line number22 index21 alt1\">22<\/div>\n<div class=\"line number23 index22 alt2\">23<\/div>\n<div class=\"line number24 index23 alt1\">24<\/div>\n<div class=\"line number25 index24 alt2\">25<\/div>\n<div class=\"line number26 index25 alt1\">26<\/div>\n<div class=\"line number27 index26 alt2\">27<\/div>\n<div class=\"line number28 index27 alt1\">28<\/div>\n<div class=\"line number29 index28 alt2\">29<\/div>\n<div class=\"line number30 index29 alt1\">30<\/div>\n<div class=\"line number31 index30 alt2\">31<\/div>\n<div class=\"line number32 index31 alt1\">32<\/div>\n<div class=\"line number33 index32 alt2\">33<\/div>\n<div class=\"line number34 index33 alt1\">34<\/div>\n<div class=\"line number35 index34 alt2\">35<\/div>\n<div class=\"line number36 index35 alt1\">36<\/div>\n<\/td>\n<td class=\"code\">\n<div class=\"container\">\n<div class=\"line number1 index0 alt2\"><code class=\"java keyword\">public<\/code> <code class=\"java keyword\">class<\/code> <code class=\"java plain\">JMeterTest<\/code><\/div>\n<div class=\"line number2 index1 alt1\"><code class=\"java plain\">{<\/code><\/div>\n<div class=\"line number3 index2 alt2\"><\/div>\n<div class=\"line number4 index3 alt1\"><code class=\"java spaces\">\u00a0\u00a0\u00a0\u00a0<\/code><code class=\"java keyword\">public<\/code> <code class=\"java plain\">JMeterTest()<\/code><\/div>\n<div class=\"line number5 index4 alt2\"><code class=\"java spaces\">\u00a0\u00a0\u00a0\u00a0<\/code><code class=\"java plain\">{<\/code><\/div>\n<div class=\"line number6 index5 alt1\"><code class=\"java spaces\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/code><code class=\"java comments\">\/\/ just for testing purposes<\/code><\/div>\n<div class=\"line number7 index6 alt2\"><code class=\"java spaces\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/code><code class=\"java plain\">System.out.println( <\/code><code class=\"java string\">\"calling the constructor\"<\/code> <code class=\"java plain\">);<\/code><\/div>\n<div class=\"line number8 index7 alt1\"><code class=\"java spaces\">\u00a0\u00a0\u00a0\u00a0<\/code><code class=\"java plain\">}<\/code><\/div>\n<div class=\"line number9 index8 alt2\"><\/div>\n<div class=\"line number10 index9 alt1\"><code class=\"java spaces\">\u00a0\u00a0\u00a0\u00a0<\/code><code class=\"java color1\">@Before<\/code><\/div>\n<div class=\"line number11 index10 alt2\"><code class=\"java spaces\">\u00a0\u00a0\u00a0\u00a0<\/code><code class=\"java keyword\">public<\/code> <code class=\"java keyword\">void<\/code> <code class=\"java plain\">setUp() <\/code><code class=\"java keyword\">throws<\/code> <code class=\"java plain\">Exception<\/code><\/div>\n<div class=\"line number12 index11 alt1\"><code class=\"java spaces\">\u00a0\u00a0\u00a0\u00a0<\/code><code class=\"java plain\">{<\/code><\/div>\n<div class=\"line number13 index12 alt2\"><code class=\"java spaces\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/code><code class=\"java comments\">\/\/ just for testing purposes<\/code><\/div>\n<div class=\"line number14 index13 alt1\"><code class=\"java spaces\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/code><code class=\"java plain\">System.out.println( <\/code><code class=\"java string\">\"calling setup\"<\/code> <code class=\"java plain\">);<\/code><\/div>\n<div class=\"line number15 index14 alt2\"><code class=\"java spaces\">\u00a0\u00a0\u00a0\u00a0<\/code><code class=\"java plain\">}<\/code><\/div>\n<div class=\"line number16 index15 alt1\"><\/div>\n<div class=\"line number17 index16 alt2\"><code class=\"java spaces\">\u00a0\u00a0\u00a0\u00a0<\/code><code class=\"java color1\">@After<\/code><\/div>\n<div class=\"line number18 index17 alt1\"><code class=\"java spaces\">\u00a0\u00a0\u00a0\u00a0<\/code><code class=\"java keyword\">public<\/code> <code class=\"java keyword\">void<\/code> <code class=\"java plain\">tearDown() <\/code><code class=\"java keyword\">throws<\/code> <code class=\"java plain\">Exception<\/code><\/div>\n<div class=\"line number19 index18 alt2\"><code class=\"java spaces\">\u00a0\u00a0\u00a0\u00a0<\/code><code class=\"java plain\">{<\/code><\/div>\n<div class=\"line number20 index19 alt1\"><code class=\"java spaces\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/code><code class=\"java comments\">\/\/ just for testing purposes<\/code><\/div>\n<div class=\"line number21 index20 alt2\"><code class=\"java spaces\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/code><code class=\"java plain\">System.out.println( <\/code><code class=\"java string\">\"calling tearDown\"<\/code> <code class=\"java plain\">);<\/code><\/div>\n<div class=\"line number22 index21 alt1\"><\/div>\n<div class=\"line number23 index22 alt2\"><code class=\"java spaces\">\u00a0\u00a0\u00a0\u00a0<\/code><code class=\"java plain\">}<\/code><\/div>\n<div class=\"line number24 index23 alt1\"><\/div>\n<div class=\"line number25 index24 alt2\"><code class=\"java spaces\">\u00a0\u00a0\u00a0\u00a0<\/code><code class=\"java color1\">@Test<\/code><\/div>\n<div class=\"line number26 index25 alt1\"><code class=\"java spaces\">\u00a0\u00a0\u00a0\u00a0<\/code><code class=\"java keyword\">public<\/code> <code class=\"java keyword\">void<\/code> <code class=\"java plain\">testMe()<\/code><\/div>\n<div class=\"line number27 index26 alt2\"><code class=\"java spaces\">\u00a0\u00a0\u00a0\u00a0<\/code><code class=\"java plain\">{<\/code><\/div>\n<div class=\"line number28 index27 alt1\"><code class=\"java spaces\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/code><code class=\"java keyword\">for<\/code><code class=\"java plain\">( <\/code><code class=\"java keyword\">int<\/code> <code class=\"java plain\">i = <\/code><code class=\"java value\">0<\/code><code class=\"java plain\">; i &lt; <\/code><code class=\"java value\">30<\/code><code class=\"java plain\">; i++ )<\/code><\/div>\n<div class=\"line number29 index28 alt2\"><code class=\"java spaces\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/code><code class=\"java plain\">{<\/code><\/div>\n<div class=\"line number30 index29 alt1\"><code class=\"java spaces\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/code><code class=\"java comments\">\/\/ just asserting randomly in order to check what happens in each case<\/code><\/div>\n<div class=\"line number31 index30 alt2\"><code class=\"java spaces\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/code><code class=\"java keyword\">int<\/code> <code class=\"java plain\">randomNumber = (<\/code><code class=\"java keyword\">int<\/code><code class=\"java plain\">)( Math.random() * <\/code><code class=\"java value\">100<\/code> <code class=\"java plain\">);<\/code><\/div>\n<div class=\"line number32 index31 alt1\"><code class=\"java spaces\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/code><code class=\"java plain\">System.out.println( randomNumber );<\/code><\/div>\n<div class=\"line number33 index32 alt2\"><code class=\"java spaces\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/code><code class=\"java plain\">assertEquals( <\/code><code class=\"java value\">0<\/code><code class=\"java plain\">, randomNumber % <\/code><code class=\"java value\">2<\/code> <code class=\"java plain\">);<\/code><\/div>\n<div class=\"line number34 index33 alt1\"><code class=\"java spaces\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/code><code class=\"java plain\">}<\/code><\/div>\n<div class=\"line number35 index34 alt2\"><code class=\"java spaces\">\u00a0\u00a0\u00a0\u00a0<\/code><code class=\"java plain\">}<\/code><\/div>\n<div class=\"line number36 index35 alt1\"><code class=\"java plain\">}<\/code><\/div>\n<\/div>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p>This test mainly contains a couple of assertions in order to check how JMeter can use them, it is not the purpose of this tutorial to explain unit testing or JUnit in detail.<\/p>\n<ul>\n<li>Add test to JUnit directory<\/li>\n<\/ul>\n<p>Package the unit test in a jar file and copy it into the directory <code>jmeter\/lib\/junit<\/code>. Ensure that the jar file contains the .class bytecode with the tests that you want JMeter to execute. At the end of this article you can find a java project with a pom.xml that you can directly use to generate a jar file that can be used by JMeter. You just need to compile the code:<\/p>\n<div>\n<div id=\"highlighter_411644\" class=\"syntaxhighlighter  bash\">\n<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n<tbody>\n<tr>\n<td class=\"gutter\">\n<div class=\"line number1 index0 alt2\">1<\/div>\n<\/td>\n<td class=\"code\">\n<div class=\"container\">\n<div class=\"line number1 index0 alt2\"><code class=\"bash plain\">mvn compile<\/code><\/div>\n<\/div>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p>Or you can export your project as JAR file including the bytecode and generated files directly in Eclipse or your favorite IDE.<\/p>\n<ul>\n<li>Add a JUnit sampler request<\/li>\n<\/ul>\n<p><a href=\"http:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2015\/01\/Junit-sampler-request.png\"><img decoding=\"async\" class=\"aligncenter wp-image-35622\" src=\"http:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2015\/01\/Junit-sampler-request.png\" alt=\"JMeter Junit sampler request\" width=\"860\" height=\"532\" srcset=\"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2015\/01\/Junit-sampler-request.png 1115w, https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2015\/01\/Junit-sampler-request-300x186.png 300w, https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2015\/01\/Junit-sampler-request-1024x634.png 1024w\" sizes=\"(max-width: 860px) 100vw, 860px\" \/><\/a><\/p>\n<p>Create a test plan as we saw before and add a sampler of the type JUnit request: <strong>Add Sampler-&gt;Junit Request<\/strong> and configure it in order to execute the methods that you want from the test that you just created above.<\/p>\n<p>In our case we are going to execute JUnit 4 based methods, but you can also do this using JUnit 3 by selecting the check box for this purpose.<\/p>\n<p><a href=\"http:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2015\/01\/Junit-Sampler-Request-Configuration.jpg\"><img decoding=\"async\" class=\"aligncenter wp-image-35623\" src=\"http:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2015\/01\/Junit-Sampler-Request-Configuration.jpg\" alt=\"Junit Sampler Request Configuration\" width=\"860\" height=\"419\" srcset=\"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2015\/01\/Junit-Sampler-Request-Configuration.jpg 1386w, https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2015\/01\/Junit-Sampler-Request-Configuration-300x146.jpg 300w, https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2015\/01\/Junit-Sampler-Request-Configuration-1024x499.jpg 1024w\" sizes=\"(max-width: 860px) 100vw, 860px\" \/><\/a><\/p>\n<ul>\n<li>Add a listener to view results as we did in previous chapters<\/li>\n<li>Run the test plan<\/li>\n<li>View the results<\/li>\n<\/ul>\n<p>Here we can see the results of the JUnit test that we have just created:<\/p>\n<p><a href=\"http:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2015\/01\/junit-view-results.png\"><img decoding=\"async\" class=\"aligncenter wp-image-35624\" src=\"http:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2015\/01\/junit-view-results.png\" alt=\"JMeter view results\" width=\"860\" height=\"600\" srcset=\"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2015\/01\/junit-view-results.png 1017w, https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2015\/01\/junit-view-results-300x209.png 300w\" sizes=\"(max-width: 860px) 100vw, 860px\" \/><\/a><\/p>\n<p>As we can see in the screenshot above, all our tests (1 test, 10 loops) failed. This is the expected behaviour since we wanted our test to fail. Actually the unit test that we just wrote has no functional meaning and it is useless. Its purpose is just to show how to configure JMeter to use these kind of unit tests.<\/p>\n<p>The stuff explained in this chapter may be very helpful to test functional and business logic of application using JMeter with all the benefits that this application provides, it is also very interesting because it makes possible to combine all the Java language advantages with the multithreating capabilites of JMeter.<\/p>\n<h2><a name=\" recording\"><\/a>13. Recording HTTP tests<\/h2>\n<p>Now we are going to explain how to configure JMeter to record HTTP requests. In order to do that we need Firefox installed in our machine, I am using the version 32.<\/p>\n<ul>\n<li>Get Firefox to use the JMeter proxy<\/li>\n<\/ul>\n<p>Go to your Firefox network settings and select the manual proxy option and set as server localhost and port 8080 (actually this deepens on your JMeter configuration). After that, check the option &#8220;Use this proxy server for all protocols&#8221;.<\/p>\n<p><a href=\"http:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2015\/01\/firefox-configuration.jpg\"><img decoding=\"async\" class=\"aligncenter wp-image-35627 size-full\" src=\"http:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2015\/01\/firefox-configuration.jpg\" alt=\"JMeter firefox configuration\" width=\"707\" height=\"714\" srcset=\"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2015\/01\/firefox-configuration.jpg 707w, https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2015\/01\/firefox-configuration-150x150.jpg 150w, https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2015\/01\/firefox-configuration-297x300.jpg 297w, https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2015\/01\/firefox-configuration-100x100.jpg 100w, https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2015\/01\/firefox-configuration-42x42.jpg 42w\" sizes=\"(max-width: 707px) 100vw, 707px\" \/><\/a><\/p>\n<ul>\n<li>First of all we create a test plan as we did before.<\/li>\n<\/ul>\n<p>We add a new Thread Group and we give a name to it. We configure the Thread Group to have 50 threads, 10 seconds as ramp-up period and number of loops equals 1.<\/p>\n<p><a href=\"http:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2015\/01\/recording-thread-group-config.jpg\"><img decoding=\"async\" class=\"aligncenter wp-image-35628\" src=\"http:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2015\/01\/recording-thread-group-config.jpg\" alt=\"JMeter recording thread group config\" width=\"860\" height=\"610\" srcset=\"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2015\/01\/recording-thread-group-config.jpg 1142w, https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2015\/01\/recording-thread-group-config-300x213.jpg 300w, https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2015\/01\/recording-thread-group-config-1024x726.jpg 1024w\" sizes=\"(max-width: 860px) 100vw, 860px\" \/><\/a><\/p>\n<ul>\n<li>Add HTTP Request Defaults.<\/li>\n<\/ul>\n<p>On the Thread Group that we just created, we add a new Config Element and we select &#8220;HTTP Request Defaults&#8221;.<\/p>\n<p><a href=\"http:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2015\/01\/recording-http-request-defaults.jpg\"><img decoding=\"async\" class=\"aligncenter wp-image-35629 size-full\" src=\"http:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2015\/01\/recording-http-request-defaults.jpg\" alt=\"JMeter recording http request defaults\" width=\"766\" height=\"468\" srcset=\"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2015\/01\/recording-http-request-defaults.jpg 766w, https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2015\/01\/recording-http-request-defaults-300x183.jpg 300w\" sizes=\"(max-width: 766px) 100vw, 766px\" \/><\/a><\/p>\n<p>You should write here the server name that you want to test.<\/p>\n<ul>\n<li>Add Recording Controller<\/li>\n<\/ul>\n<p>Now we add a recording controller to the workbench.<\/p>\n<p>Select the workbench, not the test plan, and add a Non Test Element of the type &#8220;Test Script Recorder&#8221;.<\/p>\n<p><a href=\"http:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2015\/01\/recording-workbench-test-recorder.jpg\"><img decoding=\"async\" class=\"aligncenter wp-image-35630 size-full\" src=\"http:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2015\/01\/recording-workbench-test-recorder.jpg\" alt=\"JMeter recording workbench test recorder\" width=\"811\" height=\"352\" srcset=\"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2015\/01\/recording-workbench-test-recorder.jpg 811w, https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2015\/01\/recording-workbench-test-recorder-300x130.jpg 300w\" sizes=\"(max-width: 811px) 100vw, 811px\" \/><\/a><\/p>\n<p>You should now that the workbench has to be stored independtly from your test plan. Saving your test plan does not save the workbench.<\/p>\n<p>Configure the Recorder as follows:<\/p>\n<p><a href=\"http:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2015\/01\/recording-workbench-test-recorder-configuration.jpg\"><img decoding=\"async\" class=\"aligncenter wp-image-35631\" src=\"http:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2015\/01\/recording-workbench-test-recorder-configuration.jpg\" alt=\"JMeter recording workbench test recorder configuration\" width=\"860\" height=\"616\" srcset=\"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2015\/01\/recording-workbench-test-recorder-configuration.jpg 1139w, https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2015\/01\/recording-workbench-test-recorder-configuration-300x215.jpg 300w, https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2015\/01\/recording-workbench-test-recorder-configuration-1024x734.jpg 1024w\" sizes=\"(max-width: 860px) 100vw, 860px\" \/><\/a><\/p>\n<ul>\n<li>Add timer<\/li>\n<\/ul>\n<p>If you want you can add a timer (constant) to your recorder, this timer will be used by each HTTP request that is recorded.<\/p>\n<ul>\n<li>Start recording<\/li>\n<\/ul>\n<p>By clicking on the start button of the recorder, you will start the JMeter proxy server.<\/p>\n<p><a href=\"http:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2015\/01\/recording-start-record.jpg\"><img decoding=\"async\" class=\"aligncenter wp-image-35632\" src=\"http:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2015\/01\/recording-start-record.jpg\" alt=\"JMeter recording start record\" width=\"860\" height=\"440\" srcset=\"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2015\/01\/recording-start-record.jpg 1415w, https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2015\/01\/recording-start-record-300x153.jpg 300w, https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2015\/01\/recording-start-record-1024x524.jpg 1024w\" sizes=\"(max-width: 860px) 100vw, 860px\" \/><\/a><\/p>\n<ul>\n<li>Records should appear<\/li>\n<\/ul>\n<p>If you go to a web page in order to make an example HTTP request, for example go to <a href=\"http:\/\/www.oviedin.com\">http:\/\/www.oviedin.com<\/a> using Firefox (after configuring it as explained in the first step of this chapter) you will see that different entries appear under the Recording Controller in your test plan.<\/p>\n<p><a href=\"http:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2015\/01\/records-controller.jpg\"><img decoding=\"async\" class=\"aligncenter wp-image-35633 size-full\" src=\"http:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2015\/01\/records-controller.jpg\" alt=\"JMeter records controller\" width=\"310\" height=\"294\" srcset=\"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2015\/01\/records-controller.jpg 310w, https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2015\/01\/records-controller-300x285.jpg 300w\" sizes=\"(max-width: 310px) 100vw, 310px\" \/><\/a><\/p>\n<p>These records are actually HTTP requests that have been done while querying the web page mentioned before. Only records included in the filter configured in the Test Script Recorded will be stored. They can be reconfigured and used afterwards in your test plans.<\/p>\n<h2><a name=\" plugins\"><\/a>14. JMeter Plugins<\/h2>\n<p>Different plugins are available for advanced users and use cases, some of them need extra installation, some not.<\/p>\n<p>There are very useful plugins that allow to parse results using advanced options and analyze them using graphs and charts like <a href=\"http:\/\/jmeter-plugins.org\/wiki\/GraphsGeneratorListener\/\">http:\/\/jmeter-plugins.org\/wiki\/GraphsGeneratorListener\/<\/a>.<\/p>\n<p>There are also available plugins in order to connect JMeter with your continuous integration tool and run JMeter test plans directly from the CI software like &#8220;<a href=\"https:\/\/wiki.jenkins-ci.org\/display\/JENKINS\/Performance+Plugin\">https:\/\/wiki.jenkins-ci.org\/display\/JENKINS\/Performance+Plugin<\/a>&#8221; for Jenkins.<\/p>\n<p>As i said the number of plugins is elevated and it is not possible to enumerate all of them, it is probably worth it to check if there is some plugins available in the internet before trying to implement yourself one on your own.<\/p>\n<p>You can also create your own plugin for JMeter, but this is out of the scope of this article.<\/p>\n<h2><a name=\" best_practices\"><\/a>15. JMeter best practices<\/h2>\n<p>Before this article finishes we are going to write down a couple of very useful tricks and best practices:<\/p>\n<ul>\n<li>Although the JMeter UI is a very useful and intuitive tool for configuring and creating different test plans, experience users would like to use the non-GUI mode for executing them and storing their results.<\/li>\n<\/ul>\n<p>You can do this by typing:<\/p>\n<p><code>jmeter -n -t test.jmx -l test.jtl.<\/code><\/p>\n<p>Assuming test is the test that you want to execute. You have to provide the complete path where your test is stored.<\/p>\n<ul>\n<li>Listeners are good to parse results, but they are also resource intensive and consume a lot of memory so it is good to use as few Listeners as possible in your configurations. The flag -l delete them all and it is recommended when listeners are not needed.<\/li>\n<li>Check the flag &#8220;View only errors&#8221; in the results tree view, probably you are only interested in checking what errors occurred during your tests.<\/li>\n<li>Use variables and loops in the same sampler instead of configuring several similar samples only differentiated by the variables and parameters that they are using.<\/li>\n<li>When creating Junit test plans it is recommended to provide meaningful error and assertion messages so that the JMeter output is as understandable as possible, this is a general recommendation when working with unit tests that applies completely in this case.<\/li>\n<li>Using Stop <code>(Control + '.')<\/code>. This stops the threads immediately if possible.<\/li>\n<li>Using Shutdown <code>(Control + ',')<\/code>. This requests the threads to stop at the end of any current work. Other tool tips are available at <a>https:\/\/wiki.apache.org\/jmeter\/JMeterShortcuts<\/a>.<\/li>\n<\/ul>\n<h2><a name=\" Summary\"><\/a>16. Summary<\/h2>\n<p>So that is all.<br \/>\nWe saw how to install JMeter and how to configure it for executing different kind of tests like HTTP requests, tests against databases and functional tests against Junit ones. There are many others kind of tests and possibilities offered with JMeter that are not covered in this tutorial. The objective of this tutorial is to give a whole description of the application and to show how to configure your first test plans.<br \/>\nWe also explained the main parts of the JMeter UI and how to use it and also the test plan elements that come with JMeter out of the box.<br \/>\nIn the last chapter we mentioned the possibility to expand JMeter with different Plugins; this is a very interesting point for experience users with advanced needs.<\/p>\n<h2><a name=\" download\"><\/a>17. Download<\/h2>\n<div class=\"download\">All JMeter templates, SQL scripts and Java code used in this article can be downloaded in the following link: <strong><a href=\"http:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2014\/10\/jmeter-tutorial.zip\">JMeter_Tutorial<\/a><\/strong><\/div>\n<h2><a name=\" resources\"><\/a>18. Resources<\/h2>\n<ul>\n<li><a href=\"http:\/\/jmeter.apache.org\">http:\/\/jmeter.apache.org\/<\/a><\/li>\n<li><a href=\"http:\/\/jmeter-plugins.org\/\">http:\/\/jmeter-plugins.org\/<\/a><\/li>\n<li><a href=\"http:\/\/en.wikipedia.org\/wiki\/Software_performance_testing\">href=&#8221;http:\/\/en.wikipedia.org\/wiki\/Software_performance_testing<\/a><\/li>\n<li><a href=\"http:\/\/www.tutorialspoint.com\/jmeter\/\">http:\/\/www.tutorialspoint.com\/jmeter\/<\/a><\/li>\n<li><a href=\"http:\/\/jmeter.apache.org\/usermanual\/get-started.html\">http:\/\/jmeter.apache.org\/usermanual\/get-started.html (section 2.4.3 Non-Guide Mode)<\/a><\/li>\n<li><a href=\"https:\/\/wiki.apache.org\/jmeter\/FrontPage\">https:\/\/wiki.apache.org\/jmeter\/FrontPage<\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>This tutorial is about JMeter. These are the main points that we are going to cover: We are going to explain what is JMeter used for. How is JMeter implemented and with what technologies is designed. How to install and configure it properly. We are going to explain the basic features of its user interface. &hellip;<\/p>\n","protected":false},"author":601,"featured_media":148,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[1039],"class_list":["post-32377","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-enterprise-java","tag-ultimate"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.5 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>JMeter Tutorial - The ULTIMATE Guide to Load Testing (PDF Download)<\/title>\n<meta name=\"description\" content=\"Check out our detailed JMeter Tutorial where we explain how to install JMeter and how to configure it! You can also download our FREE JMeter Ultimate Guide!\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.javacodegeeks.com\/2014\/11\/jmeter-tutorial-load-testing.html\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"JMeter Tutorial - The ULTIMATE Guide to Load Testing (PDF Download)\" \/>\n<meta property=\"og:description\" content=\"Check out our detailed JMeter Tutorial where we explain how to install JMeter and how to configure it! You can also download our FREE JMeter Ultimate Guide!\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.javacodegeeks.com\/2014\/11\/jmeter-tutorial-load-testing.html\" \/>\n<meta property=\"og:site_name\" content=\"Java Code Geeks\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/javacodegeeks\" \/>\n<meta property=\"article:published_time\" content=\"2014-11-03T14:00:24+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-12-05T14:04:42+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/java-logo.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"150\" \/>\n\t<meta property=\"og:image:height\" content=\"150\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Dani Buiza\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@javacodegeeks\" \/>\n<meta name=\"twitter:site\" content=\"@javacodegeeks\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Dani Buiza\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"26 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2014\\\/11\\\/jmeter-tutorial-load-testing.html#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2014\\\/11\\\/jmeter-tutorial-load-testing.html\"},\"author\":{\"name\":\"Dani Buiza\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/person\\\/c1d18d0e5a1ad668bab93bb4124027e5\"},\"headline\":\"JMeter Tutorial for Load Testing &#8211; The ULTIMATE Guide (PDF Download)\",\"datePublished\":\"2014-11-03T14:00:24+00:00\",\"dateModified\":\"2023-12-05T14:04:42+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2014\\\/11\\\/jmeter-tutorial-load-testing.html\"},\"wordCount\":4592,\"commentCount\":16,\"publisher\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2014\\\/11\\\/jmeter-tutorial-load-testing.html#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/java-logo.jpg\",\"keywords\":[\"Ultimate\"],\"articleSection\":[\"Enterprise Java\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.javacodegeeks.com\\\/2014\\\/11\\\/jmeter-tutorial-load-testing.html#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2014\\\/11\\\/jmeter-tutorial-load-testing.html\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2014\\\/11\\\/jmeter-tutorial-load-testing.html\",\"name\":\"JMeter Tutorial - The ULTIMATE Guide to Load Testing (PDF Download)\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2014\\\/11\\\/jmeter-tutorial-load-testing.html#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2014\\\/11\\\/jmeter-tutorial-load-testing.html#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/java-logo.jpg\",\"datePublished\":\"2014-11-03T14:00:24+00:00\",\"dateModified\":\"2023-12-05T14:04:42+00:00\",\"description\":\"Check out our detailed JMeter Tutorial where we explain how to install JMeter and how to configure it! You can also download our FREE JMeter Ultimate Guide!\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2014\\\/11\\\/jmeter-tutorial-load-testing.html#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.javacodegeeks.com\\\/2014\\\/11\\\/jmeter-tutorial-load-testing.html\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2014\\\/11\\\/jmeter-tutorial-load-testing.html#primaryimage\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/java-logo.jpg\",\"contentUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/java-logo.jpg\",\"width\":150,\"height\":150},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2014\\\/11\\\/jmeter-tutorial-load-testing.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.javacodegeeks.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Java\",\"item\":\"https:\\\/\\\/www.javacodegeeks.com\\\/category\\\/java\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Enterprise Java\",\"item\":\"https:\\\/\\\/www.javacodegeeks.com\\\/category\\\/java\\\/enterprise-java\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"JMeter Tutorial for Load Testing &#8211; The ULTIMATE Guide (PDF Download)\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#website\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/\",\"name\":\"Java Code Geeks\",\"description\":\"Java Developers Resource Center\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#organization\"},\"alternateName\":\"JCG\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.javacodegeeks.com\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#organization\",\"name\":\"Exelixis Media P.C.\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2022\\\/06\\\/exelixis-logo.png\",\"contentUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2022\\\/06\\\/exelixis-logo.png\",\"width\":864,\"height\":246,\"caption\":\"Exelixis Media P.C.\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/javacodegeeks\",\"https:\\\/\\\/x.com\\\/javacodegeeks\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/person\\\/c1d18d0e5a1ad668bab93bb4124027e5\",\"name\":\"Dani Buiza\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/5ad57f031b639d68a6e473652c4907bb6ee1fd4b691e97dff4c14c6ea4d9188c?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/5ad57f031b639d68a6e473652c4907bb6ee1fd4b691e97dff4c14c6ea4d9188c?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/5ad57f031b639d68a6e473652c4907bb6ee1fd4b691e97dff4c14c6ea4d9188c?s=96&d=mm&r=g\",\"caption\":\"Dani Buiza\"},\"description\":\"Daniel Gutierrez Diez holds a Master in Computer Science Engineering from the University of Oviedo (Spain) and a Post Grade as Specialist in Foreign Trade from the UNED (Spain). Daniel has been working for different clients and companies in several Java projects as programmer, designer, trainer, consultant and technical lead.\",\"sameAs\":[\"http:\\\/\\\/danibuiza.github.io\\\/yo\\\/\"],\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/author\\\/dani-buiza\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"JMeter Tutorial - The ULTIMATE Guide to Load Testing (PDF Download)","description":"Check out our detailed JMeter Tutorial where we explain how to install JMeter and how to configure it! You can also download our FREE JMeter Ultimate Guide!","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.javacodegeeks.com\/2014\/11\/jmeter-tutorial-load-testing.html","og_locale":"en_US","og_type":"article","og_title":"JMeter Tutorial - The ULTIMATE Guide to Load Testing (PDF Download)","og_description":"Check out our detailed JMeter Tutorial where we explain how to install JMeter and how to configure it! You can also download our FREE JMeter Ultimate Guide!","og_url":"https:\/\/www.javacodegeeks.com\/2014\/11\/jmeter-tutorial-load-testing.html","og_site_name":"Java Code Geeks","article_publisher":"https:\/\/www.facebook.com\/javacodegeeks","article_published_time":"2014-11-03T14:00:24+00:00","article_modified_time":"2023-12-05T14:04:42+00:00","og_image":[{"width":150,"height":150,"url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/java-logo.jpg","type":"image\/jpeg"}],"author":"Dani Buiza","twitter_card":"summary_large_image","twitter_creator":"@javacodegeeks","twitter_site":"@javacodegeeks","twitter_misc":{"Written by":"Dani Buiza","Est. reading time":"26 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.javacodegeeks.com\/2014\/11\/jmeter-tutorial-load-testing.html#article","isPartOf":{"@id":"https:\/\/www.javacodegeeks.com\/2014\/11\/jmeter-tutorial-load-testing.html"},"author":{"name":"Dani Buiza","@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/person\/c1d18d0e5a1ad668bab93bb4124027e5"},"headline":"JMeter Tutorial for Load Testing &#8211; The ULTIMATE Guide (PDF Download)","datePublished":"2014-11-03T14:00:24+00:00","dateModified":"2023-12-05T14:04:42+00:00","mainEntityOfPage":{"@id":"https:\/\/www.javacodegeeks.com\/2014\/11\/jmeter-tutorial-load-testing.html"},"wordCount":4592,"commentCount":16,"publisher":{"@id":"https:\/\/www.javacodegeeks.com\/#organization"},"image":{"@id":"https:\/\/www.javacodegeeks.com\/2014\/11\/jmeter-tutorial-load-testing.html#primaryimage"},"thumbnailUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/java-logo.jpg","keywords":["Ultimate"],"articleSection":["Enterprise Java"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.javacodegeeks.com\/2014\/11\/jmeter-tutorial-load-testing.html#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.javacodegeeks.com\/2014\/11\/jmeter-tutorial-load-testing.html","url":"https:\/\/www.javacodegeeks.com\/2014\/11\/jmeter-tutorial-load-testing.html","name":"JMeter Tutorial - The ULTIMATE Guide to Load Testing (PDF Download)","isPartOf":{"@id":"https:\/\/www.javacodegeeks.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.javacodegeeks.com\/2014\/11\/jmeter-tutorial-load-testing.html#primaryimage"},"image":{"@id":"https:\/\/www.javacodegeeks.com\/2014\/11\/jmeter-tutorial-load-testing.html#primaryimage"},"thumbnailUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/java-logo.jpg","datePublished":"2014-11-03T14:00:24+00:00","dateModified":"2023-12-05T14:04:42+00:00","description":"Check out our detailed JMeter Tutorial where we explain how to install JMeter and how to configure it! You can also download our FREE JMeter Ultimate Guide!","breadcrumb":{"@id":"https:\/\/www.javacodegeeks.com\/2014\/11\/jmeter-tutorial-load-testing.html#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.javacodegeeks.com\/2014\/11\/jmeter-tutorial-load-testing.html"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.javacodegeeks.com\/2014\/11\/jmeter-tutorial-load-testing.html#primaryimage","url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/java-logo.jpg","contentUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/java-logo.jpg","width":150,"height":150},{"@type":"BreadcrumbList","@id":"https:\/\/www.javacodegeeks.com\/2014\/11\/jmeter-tutorial-load-testing.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.javacodegeeks.com\/"},{"@type":"ListItem","position":2,"name":"Java","item":"https:\/\/www.javacodegeeks.com\/category\/java"},{"@type":"ListItem","position":3,"name":"Enterprise Java","item":"https:\/\/www.javacodegeeks.com\/category\/java\/enterprise-java"},{"@type":"ListItem","position":4,"name":"JMeter Tutorial for Load Testing &#8211; The ULTIMATE Guide (PDF Download)"}]},{"@type":"WebSite","@id":"https:\/\/www.javacodegeeks.com\/#website","url":"https:\/\/www.javacodegeeks.com\/","name":"Java Code Geeks","description":"Java Developers Resource Center","publisher":{"@id":"https:\/\/www.javacodegeeks.com\/#organization"},"alternateName":"JCG","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.javacodegeeks.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.javacodegeeks.com\/#organization","name":"Exelixis Media P.C.","url":"https:\/\/www.javacodegeeks.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/logo\/image\/","url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","contentUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","width":864,"height":246,"caption":"Exelixis Media P.C."},"image":{"@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/javacodegeeks","https:\/\/x.com\/javacodegeeks"]},{"@type":"Person","@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/person\/c1d18d0e5a1ad668bab93bb4124027e5","name":"Dani Buiza","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/5ad57f031b639d68a6e473652c4907bb6ee1fd4b691e97dff4c14c6ea4d9188c?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/5ad57f031b639d68a6e473652c4907bb6ee1fd4b691e97dff4c14c6ea4d9188c?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/5ad57f031b639d68a6e473652c4907bb6ee1fd4b691e97dff4c14c6ea4d9188c?s=96&d=mm&r=g","caption":"Dani Buiza"},"description":"Daniel Gutierrez Diez holds a Master in Computer Science Engineering from the University of Oviedo (Spain) and a Post Grade as Specialist in Foreign Trade from the UNED (Spain). Daniel has been working for different clients and companies in several Java projects as programmer, designer, trainer, consultant and technical lead.","sameAs":["http:\/\/danibuiza.github.io\/yo\/"],"url":"https:\/\/www.javacodegeeks.com\/author\/dani-buiza"}]}},"_links":{"self":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/32377","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/users\/601"}],"replies":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/comments?post=32377"}],"version-history":[{"count":0,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/32377\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/media\/148"}],"wp:attachment":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/media?parent=32377"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/categories?post=32377"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/tags?post=32377"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}