What is Correlation?
Correlation is the process in which a certain value is extracted from one step response to the other step request. It will capture and store the server's dynamic response and forwards it to later requests. A response is regarded as dynamic when it sends back different data for each iterative request, affecting successive requests from time to time. Correlation is an important process during the performance load test script. It is because if we don't deal with it care, the script will become worthless.
Become a master of Jmeter by going through this HKR JMeter Online Training
What is the need for correlation?
Correlation is an important aspect of the script. It retrieves the dynamic data of previous requests and displays them in the next requests.
From a test perspective, it is required to identify what response is dynamic and what is static (the data will remains the same for iterative queries). In general, each HTTP web performance test implies a data correlation. You may skip the correlation only when you are testing pages with static content, such as certain home pages and contacts. Sometimes, you may not be able to avoid the correlation handling at any given moment of the test.
Jmeter Training
- Master Your Craft
- Lifetime LMS & Faculty Access
- 24/7 online expert support
- Real-world & Project Based Learning
For greater clarity, the following are some examples:
- The test needs an evaluation of the response time for static content with a particular network condition, such as gateway, proxy, etc. Where the specification relates to the static text in response, correlation is not required as the requirement relates to the invariance of the response to the content.
- The test needs that after having created a blog post, the user can carry out one of the different actions. Correlation is certainly included in this stage because the "creation" action includes dynamic content which has to be dealt with. for example, URL path, page Id and so on.
- Once the user is authenticated, the created session cookie needs to be like: Correlation step is not needed here since this step contains authentication cookies that may be processed with the JMeter component "HTTP Cookie Manager". When it comes to data, it's actually a correlation, but already JMeter has the component which can handle that kind of data, so we need not correlate.
- Once the user arrives at the web application, the server gives them a session ID. The application will use that ID for managing user interaction. This kind of situation certainly implies a correlation; we must therefore look for which application logic must be replicated, with correlation, in the successive requests.
- When the user is browsing, the application assigns a particular condition to a cookie which modifies the successive browsing steps.
[Related Blog: JMeter Installation]
Manual JMeter Correlation
In Manual correlation, the developer will discover the correlation points in the test flow manually and will map the values to be substituted in consecutive requests.
The correlation in Apache JMeter consists of two stages:
- Extract the dynamic data of a key request and assign it to a variable.
- Re-use of one variable in each case involving dynamic data.
Now you will be able to see "Regular Expression Extractor" that will retrieve data from the previous sample's body. As a result of this component, successive queries may use the variable ${data-cmsid}, that will be mapped dynamically while running. It is the most commonly used means of manually correlating with JMeter. The application needs to be examined in depth to see where a correlation is needed.
We have the perfect professional JMeter Tutorial for you. Enroll now!
Subscribe to our YouTube channel to get new updates..!
Facilitation of manual correlation:
If you are having a little script with just a couple of correlation points, you may set a correlation manually. But if your script is big and has many correlations, then handling tends to be tedious and prone to errors for manual correlation. It is preferable to enhance the analysis of the test requirements prior to working on the large scripts with many points of correlation. This can be accomplished by dividing the large test into smaller subsets of test requirements. As far as possible, every subset must be atomic in terms of development and implementation.
The final scope of the breakdown process is to have a small script which can be aggregated or sequenced in a final execution scenario, possibly even directly in the JMeter user interface. This breakdown process, however, takes time and effort and is expensive. A much easier way would be to automate the correlation.
FREQUENTLY ASKED JMeter INTERVIEW QUESTIONS
JMeter Auto- Correlation
JMeter provides no native autocorrelation function for the desktop application. But, We may use the free BlazeMeter SmartJMX, that is part of the BlazeMeter Proxy Recorder. The recorder has produced a JMX script, according to the saved script, that is correlated automatically.
Auto-correlation in SmartJMX key features:
- SmartJMX is freely available and is part of Blazemeter's Proxy Recorder Technology.
- The Proxy Recorder technology does not need to be installed as it is completely in the web workspace.
- HTTP web recording, native mobile applications and mobile browsers are supported by SmartJMX. It is compatible with any HTTP-based application.
- Once recorded, the JMX file is ready for further processing on the local JMeter. After the script is recorded, the button SmartJMX appears. Clicking on this will produce a JMX file with all the correlation points identified automatically. Given that correlation is a significant part of the script, it is advisable to automate the process, prevent manual mistakes and save time.
[Related Blog: JMeter Performance Testing]
Conclusion:
In this blog, we have learnt about JMeter Correlation and the types of correlations- Manual JMeter Correlation and JMeter Auto-Correlation. We hope you found this information useful. For more information related to JMeter, stay tuned to HKR trainings blogs.
About Author
As a senior technical content writer for HRK tainings, srivalli patchava has a greater understanding of today's data-driven environment, which includes key aspects of data management and IT organizations. She manages the task of creating great content in the areas of software testing, DevOps, Robotic process automation. Connects with her on Linkedin and Twitter.
Upcoming Jmeter Training Online classes
Batch starts on 10th Nov 2024 |
|
||
Batch starts on 14th Nov 2024 |
|
||
Batch starts on 18th Nov 2024 |
|