Automated data correlations sometimes require manual adjustments, and complex manual correlations sometimes require a detailed understanding of how the tested application is implemented.
Necessarily, the test generator's data correlation algorithms are based on well-known best practices followed by application designers. Because these practices are continually evolving, these types of automated data correlation errors can occur:
Where two parameters that should be correlated have different names, automated data correlation fails to recognize that the two parameters are related. For example, consider the request http://www.madeupsite.com?id=12345. Instead of id=12345, the server response that this request should be correlated with is customer_id=12345. Parameter id needs to be correlated with customer_id.
Similarly, data correlation typically relates a response value returned from the server with a subsequent request value. The automated correlation algorithms look in the usual places -- URL and Post data -- for correlation candidates. But other schemes for returning parameters are possible. For example, consider the request http://www.madeupsite.com?id=12345. Instead of id=12345, the server response that this request should be correlated with is the name/entity pair href name="id" entity="12345". Parameter id needs to be correlated with name="id" and value 12345 with entity="12345".
It is possible that a parameter or value needs to be correlated with a previous parameter or value that is not named in the test, because it is computed (for example, by a Javascript program). In this case, in order to correlate correctly, you will need to understand how and where the parameter or value was computed, and then use a custom code block. Custom code is discussed in Extending tests with custom Java code.
For example, consider the URI http://www.madeupsite.com?login_stamp=12345_Dec_12_04, where login_timestamp is the concatenation of the login ID and today's date. In this case, you need custom code that performs the concatenation of the login ID and the date.
For another example, suppose that the server returned the login ID and date as separate entities (href "customer_id=12345" Date="Dec_12_04"). In this case, you can put these parameters in separate references and, in subsequent requests using customer ID and date, substitute them separately.
Automated data correlation is based on pattern matching: a parameter or parameter value is correlated with a subsequent parameter or parameter value with an exact or similar name. But sometimes parameters with exact or similar names are in fact unrelated. In the best case, unneeded correlation is either harmless or adds a slight load that is inappropriate. In the worst case, the application doesn't expect a correlation and fails during playback.
A parameter requiring data correlation might appear many times throughout a test. For example, a session ID parameter that appears initially when a user logs in might appear in every subsequent request. It is possible that multiple instances of a parameter in a test are not the same, and that the correlation algorithms will choose the wrong instance.
Parent topic: Correlating response and request data in a test