Guidelines for adjusting data correlation

 

+

Search Tips   |   Advanced Search

 


Overview

When you run a test, you might notice that the server...

Incomplete or incorrect data correlation can cause these problems.


Identify data correlation problems

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

  2. After the run, open the test log

  3. 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 are continually evolving, 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 need to be correlated have different names, automated data correlation does not recognize that the two parameters are related.

For example, consider the request...

Suppose that this request needs to be correlated with the server response containing...

...not...

In this case, the id parameter needs to 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 the request...

Suppose that this request needs to be correlated with the server response containing the name and entity pair...

...not...

In this case, the id parameter needs to be correlated with name="customer_id" and value user1 needs to 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. This is the substitution site. Select the parameter.

  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 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 correctly correlate the data, you need to understand how and where the parameter or value is computed, and then use a custom code block.

For example, consider the Web address...

...where the value for login_timestamp is the concatenation of the login ID and the current date. In this case, you need 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:

In this case, you can put these parameters in separate references and, in subsequent requests using 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 that is 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 each subsequent request. If multiple instances of a parameter in a test are not same, the correlation algorithms might choose 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 that was incorrectly correlated.

  2. Right-click the substitution site.

  3. Click Remove Substitution.

  4. Right-click the substitution site again.

  5. Click Substitute From, and select the correct parameter.


Related