DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Please enter at least three characters to search
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Zones

Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks

The software you build is only as secure as the code that powers it. Learn how malicious code creeps into your software supply chain.

Apache Cassandra combines the benefits of major NoSQL databases to support data management needs not covered by traditional RDBMS vendors.

Generative AI has transformed nearly every industry. How can you leverage GenAI to improve your productivity and efficiency?

Modernize your data layer. Learn how to design cloud-native database architectures to meet the evolving demands of AI and GenAI workloads.

Related

  • Interrupt Testing: Bulletproof Your App for the Real World
  • Test Automation for Mobile Apps: Strategy for Improved Testing Results
  • Why You Need to Shift Left With Mobile Testing
  • Exploring Mobile Device Lab: Pros and Cons

Trending

  • Enhancing Business Decision-Making Through Advanced Data Visualization Techniques
  • Advancing Your Software Engineering Career in 2025
  • How Kubernetes Cluster Sizing Affects Performance and Cost Efficiency in Cloud Deployments
  • Implementing Explainable AI in CRM Using Stream Processing
  1. DZone
  2. Testing, Deployment, and Maintenance
  3. Testing, Tools, and Frameworks
  4. How to Handle Correlation in JMeter

How to Handle Correlation in JMeter

We give a quick introduction to the process of correlation, how JMeter can help with this process, and how to automate correlation.

By 
Vincenzo Marrazzo user avatar
Vincenzo Marrazzo
·
Oct. 26, 17 · Tutorial
Likes (3)
Comment
Save
Tweet
Share
15.5K Views

Join the DZone community and get the full member experience.

Join For Free

Correlation is the process of capturing and storing the dynamic response from the server and passing it on to subsequent requests. A response is considered dynamic when it can return different data for each iterating request, occasionally affecting successive requests. Correlation is a critical process during performance load test scripting because if it isn't handled correctly, our script will become useless.

From a testing point of view, it is necessary to identify which response is dynamic and which is static (the data stays the same for iterating requests). Typically every HTTP web performance test involves data correlation. You can ignore correlation only if you are testing static content pages, like some homepages and contacts. In other cases, you can't avoid correlation handling at some point of the test.

To better clarify this point, here are some examples:

1. The test requires evaluating the response time of static content with a specific network condition (e.g. proxy, gateway, etc). - When the specification is for static text in the response, there is no need for correlation, because the requirement focuses on the invariance of the content response.

2. The test requires that after creating a post on a blog, the user can perform one of many different actions. - Correlation is definitely involved in this step because the "creation" action involves dynamic content that must be handled (eg. page Id, URL path, etc).

3. After user authentication, the created session cookie must be... - No correlation step is necessary here because this step has authentication cookies, which can be handled with JMeter's "HTTP Cookie Manager" component. In terms of data, this actually is a correlation, but JMeter already has a component that can handle this kind, so we don't need to correlate ourselves.

4. When a user lands on a web application, the server assigns her/him a session id. This id is used by the application to handle the user's interaction. - This situation quite surely involves correlation, so it's necessary to investigate which application logic should be replicated, with correlation, in the successive requests.

5. During user navigation, the application assigns a specific condition to a cookie that alters the successive navigation steps - this one is tricky! If the information handled in the cookie is read from the cookie cache, you can handle the cookie (as already seen) with the "HTTP Cookie Manager" and not correlate. In any other case, this is quite surely a correlation activity.

Manual Correlation means that the developer manually discovers correlation points in the test flow and maps the values to be replaced in consecutive requests.

Correlation in Apache JMeter™ is handled in two steps:

1. Extracting dynamic data from a key request and assigning it to a variable (e.g. "Add -> PostProcessor" components like the " Regular Expression Extractor ").

2. Reusing a variable in every occurrence that involves dynamic data.

In the picture above, you can see a "Regular Expression Extractor," which extracts information from the body of the previous sample. Following this component, the successive requests can use the variable ${data-cmsid}, which will be dynamically mapped during execution. Learn more about how to manually correlate from this blog post.

This procedure is the common way to manually correlate with JMeter. It requires a deep investigation of the application to see where correlation is required.

If you have a small script with only a few correlation points, you can correlate manually. But when your script is large and has a lot of correlations, handling tends to be time consuming and error prone for manual correlation.

Based on my experience, before starting to work on a potential "large script" with a lot of correlation points, it's better to improve your analysis on the test requirements. You can do that by breaking down the large test into smaller test requirement subsets. If possible, each subset should be atomic, in terms of development and execution.

The final scope of the breakdown process is to have a small script that can be aggregated/sequenced into a final run scenario, maybe even directly in JMeter's UI. However, this breakdown process requires time and effort, which come at a cost.

It would be much easier if correlation could be automated.

JMeter does not provide a native auto-correlation feature in its desktop application. However, you can use BlazeMeter's free SmartJMX, which is included in the BlazeMeter Proxy Recorder. The recorder generated a JMX script, based on a recorded scenario, which is automatically correlated.

  • SmartJMX is free and part of Blazemeter's Proxy Recorder Technology. You can sign up here.
  • The Proxy Recorder Technology does not require installation because it is entirely on the web workspace.
  • SmartJMX supports HTTP web recording for the web, mobile browsers, and native mobile apps. It's suitable for any application based on HTTP.
  • After recording, the JMX file is available for post-processing on your local JMeter. After recording your script, the SmartJMX button appears. By clicking on it you will get a JMX file with all the correlation points automatically identified.

Since correlation is such an important part of scripting, it's recommended to automate the process, to avoid manual errors and to save time.

Correlation (projective geometry) mobile app Testing

Published at DZone with permission of Vincenzo Marrazzo, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

Related

  • Interrupt Testing: Bulletproof Your App for the Real World
  • Test Automation for Mobile Apps: Strategy for Improved Testing Results
  • Why You Need to Shift Left With Mobile Testing
  • Exploring Mobile Device Lab: Pros and Cons

Partner Resources

×

Comments
Oops! Something Went Wrong

The likes didn't load as expected. Please refresh the page and try again.

ABOUT US

  • About DZone
  • Support and feedback
  • Community research
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Core Program
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 100
  • Nashville, TN 37211
  • support@dzone.com

Let's be friends:

Likes
There are no likes...yet! 👀
Be the first to like this post!
It looks like you're not logged in.
Sign in to see who liked this post!