Correlation: Dynamic data handling using Apache JMeter

In this article, We will talk about how to handle dynamic data in JMeter which is  basically Correlation. Correlation is the important aspect of scripting. Proper handling of dynamic data results in building effective test scripts.

What is Correlation and why is it required ?

Correlation is an act of fetching dynamic data from preceding requests/calls and posting it to the subsequent requests/calls. Lets envision an example to find out why we need correlation. Suppose we have recorded a scenario in which user does the following transactions

  • User enters login details and click submit button,
  • Home page opens and user take further actions,
  • And then Logs out of the system.

Soon after recording if you try to run the script, it may even fail for a single user. This might be because of numerous reasons, lets assume that one of the reason might be authentication mechanism implemented. When a user logged into the system, a unique session is created for user and it will be active until the user logs out of the system. Lets imagine, a unique tokenId is dynamically generated up on user login and is passed to the subsequent requests to validate the user actions. So, one cannot just record and playback the requests having these tokenId’s which are unique for every user sessions. Here, we need to correlate the web requests with the dynamic variables (tokenId). And for correlation, we need to use the “Regular Expression Extractor” which makes use of regular expressions or most commonly known as RegEx.

Continue reading Correlation: Dynamic data handling using Apache JMeter

JMeter Complete Element Reference – Part VII

In this article, I will talk you through about the next set of JMeter elements i.e Assertions. These elements plays a crucial role in validating samplers in our test scripts. Lets discuss in detail about the advantages and disadvantages in using assertions. In case if you have missed the older articles click here.


From the previous posts, we are all aware that how to send requests and get response from the target server. Now you may have many questions running in your mind like are we receiving expected or desired response from the server, how can we validate the received response  through JMeter. In this case, Assertions come to your rescue !!

Assertions are used to perform additional checks on samplers, and are processed after every sampler in the same scope. To ensure that an Assertion is applied only to a particular sampler, add it as a child of the sampler. By default assertions can be applied only to main samples but JMeter also provides an options to include  assertions only to sub-samples or both. Scope of the assertions can be as follows:


If a sub-sampler fails and the main sample is successful, then the main sample will be set to failed status and an Assertion Result will be added. If the JMeter variable option is used, it is assumed to relate to the main sample, and any failure will be applied to the main sample only. More than one assertion can be added to the sampler, controller, thread group or test plan. Failed assertions will cause all affected samples to fail.

Continue reading JMeter Complete Element Reference – Part VII

JMeter Complete Element Reference– Part VI

In this article, we will discuss about the next set of JMeter elements i.e Pre-Processors and Post-Processors. Lets discuss in detail, how do we use these elements to build a effective test scripts . In case if you have missed the older articles click here.

Pre Processor Elements

A Pre-Processor elements executes some action prior to a Sampler Request being made. If a Pre-Processor is attached to a Sampler element, then it will execute just prior to that sampler element running. A Pre-Processor is most often used to modify the settings of a Sample Request just before it runs, or to update variables that aren’t extracted from response text.

Post Processor Elements

A Post-Processor elements executes some action after a Sampler Request has been made. If a Post-Processor is attached to a Sampler element, then it will execute just after that sampler element runs. A Post-Processor is most often used to process the response data, often to extract values from it.

Execution order of the Elements:

Lets understand in which order JMeter process the elements when multiple elements are added to the thread group.

  1. Configuration elements
  2. Pre-Processors
  3. Timers
  4. Sampler
  5. Post-Processors
  6. Assertions
  7. Listeners

Please note that Timers, Assertions, Pre- and Post-Processors are only processed if there is a sampler to which they apply. Logic Controllers and Samplers are processed in the order in which they appear in the tree. Other test elements are processed according to the scope in which they are found, and the type of test element.

Continue reading JMeter Complete Element Reference– Part VI

JMeter Complete Element Reference – Part V

In this article, we will discuss about the next set of elements i.e Timers, importance of timers, types of timers and their usage  in our test. In case if you have missed the older articles, click here 12, 3, 4.

Apache JMeter sends requests to the target server without pausing between each request by default. In that case, the target server can be over flooded with numerous requests with in a very short span which may lead to server overload. So how to prevent jmeter from overloading the target server and how to pace each request in our test execution to achieve real time behavior. The answers is quite simple Timer. 🙂

Timers allow JMeter to delay between each request which a thread makes. Timer can solve the server overload problem. Also, in real life visitors do not arrive at a website all at the same time, but at different time intervals. So Timer will help mimic the real time behavior.

Timers are only processed in conjunction with a sampler. A timer which is not in the same scope as a sampler will not be processed at all. To apply a timer to a single sampler, add the timer as a child element of the sampler. If a timer is placed before a sampler in the test script, timer will be applied before executing before any sampler. To apply a timer after a sampler, either add it to the next sampler, or add it as the child of a Test Sampler.

Continue reading JMeter Complete Element Reference – Part V

JMeter Complete Element Reference – Part IV

In this article, we will discuss about  the next set of elements i.e Logic Controllers, importance  of controllers, types of controllers and their usage  in our test. In case if you have missed the older parts, click here 12, 3.

Logic Controllers

Logic Controllers let you customize the logic that JMeter uses to decide when to send user requests. Logic Controllers basically determine the order in which Samplers are processed. They can modify the requests themselves, cause JMeter to repeat requests, etc.

Continue reading JMeter Complete Element Reference – Part IV

Recording HTTPS Traffic with JMeter’s Proxy Server

If you read our article, Recording using Jmeter HTTP Proxy Server, then you already know how to use JMeter’s Proxy Server to record HTTP traffic.
But what if a website uses SSL encryption? 
Then, you better make some configuration changes. How? We’ll tell ya’.

Record HTTPS Traffic with the JMeter Proxy Server

By default, JMeter supports recording HTTPS (SSL) in versions 2.3.4+ and HTTP Samplers are configured to accept all certificates, whether trusted or not.
To record encrypted traffic, first configure the JMeter Proxy Server and browser proxy settings. We used Firefox for this example.

HTTP Request Sampler

In the last article, we discussed about Samplers, sampler usage and many more . In case if you have missed click here. In this article, We will discuss about the most important and frequently used sampler i.e “HTTP Request Sampler”.

HTTP Request Sampler

This sampler lets you send an HTTP/HTTPS request to a web server. It also lets you control whether or not JMeter parses HTML files for images and other embedded resources and sends HTTP requests to retrieve them. The following types of embedded resource are retrieved:

  • images
  • applets
  • stylesheets
  • external scripts
  • frames, iframes
  • background images (body, table, TD, TR)
  • background sound

The default parser is htmlparser. This can be changed by using the property “htmlparser.classname” – see for details.

If you are going to send multiple requests to the same web server, consider using an HTTP Request Defaults Configuration Element so you do not have to enter the same information for each HTTP Request.

Or, instead of manually adding HTTP Requests, you may want to use JMeter’s HTTP(S) Test Script Recorder to create them. This can save you time if you have a lot of HTTP requests or requests with many parameters.

Continue reading HTTP Request Sampler

JMeter Complete Element Reference – Part II

In this article, we will discuss about  the next set of elements i.e Samplers, importance  of samplers, types of samplers  and their uasge  in our test. If you have missed the first part, click here


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(will get to know in future posts 😛 ).

As we all know that Apache JMeter has ability to load and performance test many different server/protocol types such as HTTP, FTP, SOAP, LDAP, JDBC etc and we aslo know that Thread Group forms the base for simulating requests to the server.  Now we have problem here, how does a thread group knows which user request to make ? more over user request can be FTP request or HTTP request or SOAP request. The answer is quite simple Samplers, using samplers we can define what kind of request has to be simulated using JMeter.  Apache JMeter supports various types of samplers, lets go through each sampler in detail :

Continue reading JMeter Complete Element Reference – Part II