Bug 63640 - Auto-Correlation as core functionality in JMeter
Summary: Auto-Correlation as core functionality in JMeter
Status: NEW
Alias: None
Product: JMeter - Now in Github
Classification: Unclassified
Component: HTTP (show other bugs)
Version: 5.2
Hardware: PC All
: P2 enhancement with 2 votes (vote)
Target Milestone: JMETER_5.2
Assignee: JMeter issues mailing list
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-08-06 09:02 UTC by Takashi Imoto
Modified: 2022-08-03 14:35 UTC (History)
0 users



Attachments
Use cases of Auto Correlation (144.63 KB, image/png)
2019-08-06 09:02 UTC, Takashi Imoto
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Takashi Imoto 2019-08-06 09:02:40 UTC
Created attachment 36704 [details]
Use cases of Auto Correlation

Purpose:
If a JMeter script has API parameters that require correlation, then the User needs to manually correlate them using JMeter Post-Processors. This becomes a hassle when the test scenarios are very large.

Manual procedure of Correlation has following steps:
-Identify API parameters that require Correlation.
-Create "Regular Expression Extractor" by analysing API response.
-Modify the script by setting "Regular Expression Extractor" names wherever correlated parameters are used.

Manual Auto-Correlation leads to following problem:
-Increased complexity.
-Time-consuming.
-Error-prone.


Solution:

Record same senario 2 times. 
Comparing these 2 scripts, it can be seen that a value with a difference variable may be a correlation variable.
Automate the following steps which are involved in the correlation process.

-Identify the parameters which are candidates for correlation by comparing 2 scripts.
-Create "Regular Expression Extractor" by analysing API response.
-Add "Regular Expression Extractor" into the script.


Solution Design:


Abbreviations:
-JMX–X: Test Plan Xth recording.
-JTL–Y: Recording log of Yth recording.
-Test-Engineer: Person who records the test plan.
-Test-Designer: Person who can perform manual Correlation in JMeter.


Use-Case:
There are two use cases being considered:
1. The Test Designer records the test plan and performs the Correlation himself. In this use case the test plan is kept in JMeter memory along with recording's logs.
2. The Test-Engineer records the test plan and Test-Designer performs the Correlation. In this use case Test-Engineer saves test plans and its recordings and shares them to the Test-Designer for selecting the appropriate parameters which are required to be correlated.


Procedure
* Refer attached screen images.

Step 1: Import scripts and recording logs.
Use case 1
1a. Record Test Plan and save it.
1b. Record Test Plan again and keep JMeter open.
1c. Right Click on Test Plan and click CoRelation.
1d. Import JMX-1.
Use case 2
1a. Record Test Plan and save it.
1b. Record Test Plan again & save its script and recording log.
1c. Click on Edit and click CoRelation.
1d. Import JMX-1, JMX-2 and JTL-2 and click CoRelation.


Step 2: Parameter Selection
List of parameters which can be correlated is displayed.
Select the parameters you want to correlate and Click OK.

Output
"Regular Expression Extractor" for the selected parameters have been created successfully and added to the script. The script is successfully correlated and can be used for load testing now.
Please refer to attached file for more details.


And we already prepare the prototype to confirm of our approach for Use case 1.
If community interest it, our company will submit PR of this.
Comment 1 Michael Johnson 2022-08-03 14:35:29 UTC
Blazemeter came out with a plugin that did the same and worked great until JMeter version 5.5 came out. BlazeMeter Correlation Recorder. The correlation recorder is implemented using Reqex for the extractions and replacements. It's implementation has worked better than Load Runners (VUGen) Recording Rules. 

Being able to use the Autocorrelation rules has become a huge time saver and it's odd that Apache hasn't implemented something of the same with it's HTTP(S) Test Script Recorder.

I know this is an old request (from 2019) but didn't see the need to create a new as it's description fits the need. 
This is an enhancement request to implement a rules based auto correlation engine as part of the standard JMeter HTTP(S) Test Script Recorder.
Comment 2 The ASF infrastructure team 2022-09-24 20:38:17 UTC
This issue has been migrated to GitHub: https://github.com/apache/jmeter/issues/5136