Associating a test value with a dataset column

After you have created a dataset and have enabled your test to use the dataset, you can associate a specific value in the test with a specific dataset column.

Procedure

  1. In the Test Navigator, browse to the test and double-click it. The test opens.
  2. Locate and click a request that contains a value to replace with variable data.
    Clicking a test page displays a table that lists dataset candidates and correlated data on that page. (If correlated data is not displayed, right-click the table and verify that Show References is selected.) References are color coded in blue and dataset candidates are color coded in black.
    table with one black row, showing one datapool candidate

    If the contents of the Value column corresponds exactly with column data in your dataset, click the row, and then click Substitute. The Select Data Source window is displayed. Skip to step 6. You can ignore step 8 because the URL encoding is preselected.

    Otherwise, double-click the row to navigate to the page request that contains the value to replace from a dataset, and continue to the next step.

    The value to replace from a dataset might not be listed in any page table. In this case, manually locate the request string that includes the value.

  3. If the value to replace from a dataset is part of a string that has been designated a dataset candidate, you must remove the light green highlight: right-click and select Remove Substitution.
    For example, if you searched for doe, john in your test, the dataset candidate in your test is displayed as doe%2C+john. Suppose that you do not want to associate this candidate with a single dataset column that contains data in the format doe, john. Instead, you want to associate doe and john with separate dataset columns. In this case, you must first remove the substitution.
  4. Highlight the value: With the left button pressed, drag your mouse over the value.
  5. Right-click the highlighted value, and select Substitute > Select Data Source.
    The Select Data Source window is displayed.
    Note: To use a dataset that is not listed, click Dataset: the Select dataset column window is displayed.
  6. Click the name of the dataset variable, or column, to associate with the test value.
  7. Click Select.
    To indicate that the association has been set, the highlighting for the selected test value turns dark green, and the dataset table for this page is updated as shown in the example.
    table with two green rows
  8. Optional: Encode variable data when it is substituted from a dataset.

    If a test value contains special characters such as spaces or commas, click the row and select URL Encode. With this option, special characters are encoded when variable data is substituted from a dataset. For example, data that is space-separated in a dataset column might need to be encoded. When the URL encoding is enabled, John Doe is substituted as John%20Doe. If the URL encoding is not selected, the variable data that is substituted is literal. Do not enable URL encoding for datasets that contain data that is already encoded.

  9. Optional: If you substitute an element of a page with a dataset column, to view the substitutions in the Page Elements report, in the Test Elements Details area of the request click the Use the substituted URL in performance reports check box.
  10. Save the test.