Correlating a request value with test data

If a test runs without error but does not generate the results that you expect, you might need to correlate a value in a request with other test data.

About this task

You can correlate a request value with the following types of test data:
  • References
  • Datasets
  • Custom code
  • Test variables
  • Built-in datasources
For example, if you recorded a test and searched on a date, you might want to substitute the built-in data source Current Date so that the test will search on the playback date, not on the recorded date. For information on the different types of test data, see Test data sources overview.

Procedure

  1. In the Test Navigator, browse to the test, and double-click it. The test opens in the test editor.
  2. Locate the value that the other test data will replace.
  3. Highlight the value: Press and hold the left mouse button and drag your mouse over the value.
  4. In the Test Data Sources window, click the appropriate tab: References, Datasets, Custom Code, Test Variables, or Built-in Datasources. To see all references, clear the Matching Only check box.
  5. In the Test Data Sources window, select the test data to use. For references and custom code, you can double-click the entry in the Test Data Sources window to find the data source in the test editor.
  6. Click Substitute From.
    The value is shown in purple text to indicate that it has been correlated and the correlation is added to the Test Data table, which contains the substitution sites for the page.