Data Correlation seems to be a buzz word when you are handling dynamic data values while performance testing.
So, what does "Data Correlation" / "Data Parameterization" actually mean ??
There are lot of explanations provided on internet and different approaches taken to describe this buzz word. As it relates to performance testing, this task is about how you make the script play around with the dynamic data values required in subsequent request to be sent to the server. In a single statement, you can define it as.....
"A request can include data that was returned in the response to a previous request. Associating data in this manner is called data correlation"
Many would now come up with questions like ....
1) How do I identify which values are dynamic in nature?
2) Which request would require this dynamic value prior to hitting the server?
...... and so on.
Remember that identification of these values are not generic in nature and depends on how the application under test respond and what it expects for delivering a successful response. These dynamic values would generally be residing in the response contents where upon identifying, you create a "Reference" value.
The subsequent request is in a state of accepting this "Reference" value. You now identify specific value in this request data (Substitution) where you want to substitute the "Reference" value so that it gets carried when the request is sent to server.
Probably now you might be thinking as to how to I start this task in RPT...
- You would like to start at the substitution site.
- Highlight the value right click and say Substitute -> Select Data Source.
- Make sure to check the button include potential matches, and RPT will find all the places in the response where that value exists and show them to you.
- You can then pick the one you want and RPT will create a reference for you.
- You can edit the properties of the reference if the regular expression is not unique enough for you. RPT is built on regular expressions for harvesting the data. It uses java regular expression syntax and there are many web sites around that will guide you through that if you need it.
Also, in the latest version of RPT there are data correlation rules that you can apply to a test. So, if your dynamic value has a definite pattern you can write a rule for that correlation. You can then apply the rule set to each test your record and the correlations will be made automatically for you.
All set, but how do you validate which values were created as "Reference" and what are the "Substitution" entries??
Let's discuss this with an example here.
You can open the correlation rule file that was shared earlier in RPT and walk through the references and substitutions made.
In the below screenshot, there was a reference created for some value which is part of the response header field and was named as "X-ORACLE-BPMUI-CSRF".
Now, if you expand the "Create Reference" tree structure, you see the substitutions where this reference was used. In the below screenshot, the substitution was named as "X-ORACLE-BPMUI-CSRF".
You can copy the substitution name(X-ORACLE-BPMUI-CSRF) and search on the Test script name which takes you to those requests where the substitution was made by the reference that was created