Data correlation overview
A request can include data that was returned in the response to a previous request. Associating data in this manner is called data correlation.
- A payroll clerk types the web address for an application, which sends a login prompt. When the clerk logs in, the web server returns a page that indicates that login has succeeded and a unique session ID to the web browser that the clerk is using.
- The clerk clicks a link on the returned page, which requests that the web server open the page for searching the employee database. The web browser includes the session ID when sending the request. Based on the session ID, the web server knows that the request comes from someone who is already logged on, and so opens the search form for the employee database. The clerk then searches for a specific employee. The web server returns a photograph of that employee and the employee's unique ID.
- The clerk clicks a link that requests the web server to return
the payroll record for the employee. With this request, the web browser
sends two IDs:
- The session ID, so that the web server knows that the request comes from some who is logged on
- The employee ID, so that the web server can locate and return the correct information
If you record these interactions in a test, before running the test with multiple users, you would vary the test data. For example, you would replace the user name and password values, the employee name search values, or both, with values that datasets contain. When you run the test, each virtual user returns a different employee payroll record, based on the contents of the datasets.
In a generated test, where data in a request depends on data that is contained in the response to a previous request, the request data is substituted from the response data on which it depends. The term for this internal linking of response and request data is data correlation. When you run a test with multiple users and varied data, data correlation is required to ensure that the test runs correctly.
By default, the empty strings are not correlated because it might increase the time taken to generate a test. However, sometimes empty strings such as spouse name or middle initial become important to correlate. To correlate the empty strings, click Create substitutions for empty strings check box.
and select theGenerally, the HTML response content after the recording appears as <input type="username" name="User" id="aaa" value="John"/>. Some applications dynamically update the name attribute. Therefore, when you play back the test, the HTML response content appears as <input type="username" name="idt020" id="aaa" value="John"/>. Because the name attribute changes dynamically, data correlation does not occur and the playback fails. For data correlation to correlate the response content based on the ID attribute, ensure that you have selected ON in the Priortize correlation based on ID option at .
- When you click a page, you see a Test Data table for that page. By default, related dataset candidates are shown in green text on a light green background, values that are already associated with a dataset are shown in white text on a green background, and references are shown in blue text.
- If correlated data is not displayed, right-click the table and verify that Show References is selected. To navigate directly to a page request containing correlated data, double-click a table row. To associate correlated data from this table with a dataset, click the row, click Substitute, and then click Select Data Source to open the Select Data Source window. You can also use the Test Data Sources view to make substitutions. In the test editor, right-click the Test Data table, and then select Link with Test Data Sources View. When you click a row in the Test Data table, the Test Data Sources view displays information about the selected substitution site.
- When you expand a page, green text indicates page requests that contain dataset data or candidates. Blue text indicates page requests that contain references.
- When you click a highlighted request, dataset candidates are highlighted in light green, data that is associated with a dataset is highlighted in dark green, and correlated data is highlighted in red. If you right-click a value for correlated data, as shown in the example, you can then click Go To to see its reference:
- References are highlighted in dark blue.