Still Grappling with the Headaches of Manual Correlation in Performance Test Scripts
Delvis Echeverria
Software QA Manager / Tech Lead / QA and Testing Instructor
And yes, I know it can be a headache to carry out manual correlation. Just a few days ago, I had to manage all the cookies for my web application because the cookie manager in JMeter wasn’t handling them correctly in an automated way. Can you imagine how much time I spent doing the correlation for the cookies?
Correlation is a critical aspect of performance testing, ensuring that dynamic data, such as session IDs or tokens, are correctly handled between requests.
Due to its complexity and the amount of time it requires, several tools and plugins have been developed to automate it. From my experience using various tools or plugin (including one I developed a few years ago), it's evident that while these tools can significantly simplify "or not" the correlation process, manual intervention is often necessary to ensure accuracy.
I know friends some colleagues who have started using automated correlation solutions, especially in JMeter, even without fully understanding the manual correlation process. But what if these "semi-automated" solutions can't handle your app? This is why it's essential to understand this process.
In my opinion, understanding and performing manual correlation is essential for any performance tester to achieve a precise and reliable script.
These code examples are just portions of the scripts built from the three tools. We will soon be hosting an online workshop showing a complete example with these tools JMeter-Gatling-Locust. Stay tuned!
Firstly, What is Correlation?
Correlation is the process of capturing dynamic data from a server's response to a request and then using this data in subsequent requests. This is essential for maintaining session state, dynamic values updates, etc... and ensuring that the test scripts simulate real user interactions accurately.
Lets see this with a real example.
Example Scenario
Let’s consider a simple scenario with two requests: HomePage and Login POST.
Request 1: HomePage
Description:
Request:
Response: The server responds with the homepage HTML, which includes a securityToken in the JavaScript section.
Response Example:
In this response, the securityToken value '02454ce177e373e37c262703029f03df' is dynamically generated by the server and must be captured in HomePage and reused in the Login POST request.
Request 2: Login POST
Description:
Request:
Form Data:
Manual Correlation Process
To handle this manually, follow these steps:
领英推荐
Using JMeter
HomePage Request: Extract SecurityToken
Login POST Request
Replace the extracted securityToken.
Using Gatling
Step 1: HomePage Request
Step 2: Login POST Request
Using Locust
Step 1: HomePage Request
Step 2: Login POST Request
Conclusion
Understanding and implementing manual correlation is crucial for accurate performance testing. By following these detailed steps, you can ensure that dynamic values are correctly handled, leading to more reliable test results.
If you have any questions or need further assistance.
You can practice in my Performance Scripting Demo Web App, feel free to reach out!
Principal QA Automation Engineer at Xplor Technologies
2 个月This looks great Delvis, looking forward to more such articles covering complex performance testing concepts explained in a simplistic manner ??
Qa Engineer
2 个月Great Delvis! A lot of work behind it!
Software Engineering leader, Driving Excellence in Product Quality
2 个月Sharing our day today learnings on bigger platform is commendable