Guidelines for adjusting data correlation

When you run a test, you might notice that the server is not under the expected load or that your database is not being updated as expected. Incomplete or incorrect data correlation can cause these problems.

To identify data correlation problems:

  1. Use the Potential Correlation Errors view to find missing or incorrect data correlations. See Finding data correlation errors for more information.

  2. Run a test individually or in a schedule with the Log Level for errors, failures, and warnings set to All.

  3. After the run, open the test log as explained in View the test logs.

  4. As explained in Inspecting test log details in the Protocol Data view, verify that each call to the server returned the expected data.

The data correlation algorithms that are used during test generation are based on well known best practices. However, because these practices continually evolve, various types of errors can occur during automated data correlation:


Insufficient correlation: Parameters have different names or occur in unexpected locations

When two parameters that must be correlated have different names, automated data correlation does not recognize that the two parameters are related. For example, consider this request: http://www.example.com?id=12345. Suppose that this request must be correlated with the server response containing customer_ID=12345, not ID=12345. In this case, the ID parameter must be correlated with customer_ID.

Data correlation typically links a response value that was returned from the server with a subsequent request value. The automated correlation algorithms search in the URL and the POST data for potential matches; however, other schemes for returning parameters are possible. For example, consider this request: http://www.example.com?id=12345. Suppose that this request must be correlated with the server response containing the name and entity pair href name="customer_ID" entity="12345", not ID=12345. In this case, the ID parameter must be correlated with name="customer_ID" and value 12345 must be correlated with entity="12345".

Here are some additional causes of insufficient correlation:

To manually correlate data in these cases:

  1. In the test editor, use search or browse to locate the two parameters for correlation.

  2. Navigate to the parameter that occurs later in the test, and select the parameter. This is the substitution site.

  3. In the Test Data Sources window, click the References tab.

  4. Select the data source to use as a reference, and then click Substitute From.


Insufficient correlation: One parameter is unnamed

Sometimes a parameter or value must be correlated with a previous parameter or value not named in the test, because it is computed, for example, by a JavaScript program. In this case, in order to correctly correlate the data, you must understand how and where the parameter or value is computed, and then use a custom code block. See Extend test execution with custom code for more information about custom code.

For example, consider the web address http://www.example.com?login_stamp=12345_Apr_11_07, where the value for login_timestamp is the concatenation of the login ID and the current date. In this case, you must generate a custom code that concatenates 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="Apr_11_07". In this case, you can put these parameters in separate references and, in subsequent requests that use customer ID and date, substitute them separately.


Superfluous correlation

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 inappropriate. In the worst case, the application does not expect a correlation and fails during playback.

To remove a superfluous data correlation:

  1. In the test editor, search or browse to locate the substitution site that must not be correlated. By default, purple letters indicate correlated data.

  2. Right-click the substitution site.

  3. Click Remove Substitution.


Incorrect correlation

A parameter that requires data correlation might occur many times throughout a test. For example, a session ID parameter used initially when a user logs in might also be used in every subsequent request. If multiple instances of a parameter in a test are not same, the correlation algorithms might use the wrong instance.

With the HTTP Test Generation preferences, you can optimize automatic data correlation for accuracy or for efficiency.

If you do not manually apply a correlation in the Referer field in an HTTP request header, then the Referer field is automatically correlated as needed. If you manually apply a correlation in the Referer field in an HTTP request header, then no automatic correlation is performed.

Incorrect correlations are more likely to happen when Optimize automatic data correlation for execution is set to Efficiency. To fix an incorrect correlation:

  1. In the test editor, search or browse to locate the value incorrectly correlated.

  2. Right-click the substitution site.

  3. Click Remove Substitution.

  4. Right-click the substitution site again.

  5. Click Substitute, and select the correct parameter.


Related:

Data correlation overview
Data correlation rules overview
Test data sources overview
View data correlation
View references
Create a reference or field reference
Correlate multiple fields in a test
Finding data correlation errors
Disable data correlation
Recorrelating test data


Error 404 - Not Found

Error 404 - Not Found

The document you are looking for may have been removed or re-named. Please contact the web site owner for further assistance.