Correlation in JMeter


Correlation is the process of extracting information from the response of one request and using it in the request of another step at runtime. This is necessary when dynamic values from the response of previous requests needs to be passed in subsequent requests.

Correlation is used in performance testing for dynamic websites, where the server responds to dynamic variables that keep on changing every time

Correlation can be achieved using below components on need basis and these are part of post processor component group .

  1. Boundary Extractor :  It can be used when we have fixed right and left boundary of the dynamic value which needs to be captured. 
  2. Regular Expression Extractor : It can be used capture dynamic value based the regular expression.
  3. JSON Extractor :  It can be used capture dynamic value when the response is in JSON format.
  4. XPath/Xpath2 Extractor :  It can be used capture dynamic value from any HTML element using HTML expression. Xpath2 Extractor gives better performance with latest JMeter version.
  5. CSS Selector Extractor : It  allows you to extract values from the response based on CSS selectors


The following steps are involved in using correlation with the Regular Expression Extractor in JMeter:

  1. Create a test plan where you want to do dynamic referencing in JMeter.
  2. Add a  Extractor in the step from where response value(s) needs to be extracted.
  3. Refer the extracted value (referred by the variable name) in the following request and future submissions .
  4. The Extractor is used to extract the dynamic value  from the response body and store it in a variable of your choice . This variable can then be used in subsequent requests.

In summary, correlation is a crucial aspect of JMeter that enables the reuse of scripts by handling dynamic variables in responses. The Regular Expression Extractor is a key tool for achieving correlation in JMeter.



Comments