Recorrelating data with rules

After you have created a data correlation rule set, you can recorrelate data in tests.

Before you begin

Record a test, and create a data correlation rule set.

Procedure

  1. Open a test for editing. To recorrelate data in tests that are not open in the editor, select multiple tests in the Test Navigator window.
  2. To recorrelate a test that is open in the test editor, click Edit > Re-correlate test and transform data. To recorrelate multiple tests, right-click the selected tests in the Test Navigator window, and then select Apply data correlation rules.
    The Data Correlation and Transformation window opens.
  3. Select Do rule-based data correlation.
  4. Optional: To remove data correlation from the test data, select Clear existing data correlation. Select Do automatic data correlation to recorrelate the test data by using the automatic data correlation.
    You can control automatic data correlation in the preferences. Click Window > Preferences > Test > Test Generation. Click HTTP Test Generation, and then click the Data Correlation tab for additional controls over automatic HTTP data correlation.
  5. Click Add.
    The Rules File Selection window opens.
  6. Expand the list of resources to locate the data correlation rules file to add.
  7. Select the data correlation rules file to add, and then click OK.
    Data correlation rules files have the .dcrules extension by default.
    The rules file is added to the list under Rules Files.
  8. Optional: Click Add to add more rules files. Use the Up and Down push buttons to move rules files in the list. The data correlation rules are applied in the order in which the files are listed.
  9. Click Finish.
    The test data is recorrelated.

Results

If you recorrelate test data in multiple tests that are not open in the test editor, the original tests are backed up. The backup copies are displayed in the list in the Test Navigator window. To restore the original version of the test, right-click the backup copy in the Test Navigator window, and then select Restore test.