Lesson 7: Associating a dataset with a test

You can learn about associating a dataset with a recorded test to add actual data to the test during the playback. The associated dataset is accessed during the playback of the test and the actual data in the test is substituted with the variable data in the dataset.

Before you begin

You must have completed the following tasks:

About this task

For the test scenario in this tutorial, you can associate the AnimalsDataset dataset with the wiki-search-animals test.

Procedure

  1. Select the Enter value 'Elephant' in Search field action in the wiki-search-animals test.
    The details of the selected action are displayed in the User Action Details panel.
  2. Right-click Elephant in the Value field, and then click Substitute > Select Data Source.
    Image of the User Action Details panel

    The Test Editor - Select Data Source dialog is displayed.
  3. Click Yes to display all the matching strings in the test that you can use as a data source to substitute the value of Elephant in the Value field.
    The Select Data Source dialog is displayed.
  4. Click the Add Dataset icon Icon of Add Dataset.
    The Select dataset column dialog is displayed.
  5. Select AnimalsDataset.csv in the Available Datasets panel, and then select Column1 in the Columns panel.
    image of the Select dataset column dialog

  6. Click Finish.
    The AnimalsDataset dataset is displayed in the Select Data Source dialog.
  7. Ensure that AnimalsDataset dataset is selected, and then click Select.
    Image of the Select Data Source dialog

    The Test Editor - Find and Substitute dialog is displayed to confirm whether you want to view more substitutable locations in the test.
  8. Click Cancel.

    The color of Elephant in the Value field of the User Actions Details panel changes to green. The change indicates that the selected dataset is successfully associated with the field.

    Image of the User Actions Details panel

  9. Press Ctrl+S to save the changes.

Results

You have learned to associate a dataset with your test.

What to do next

You can learn about creating a compound test to combine various test scripts. See Lesson 8: Creating a compound test.