Linking datasets to a functional test script

You can link datasets to a functional test script to override the existing dataset that is associated with the script. To link a dataset, you must include the functional test script in a compound test in the UI Test perspective, and then map the required dataset by using Dataset Mapper.

Before you begin

You must have completed the following tasks:

About this task

If the compound test includes a Dataset Mapper that retrieves values from one dataset and a test in the compound test is also associated with another dataset, the run uses both the datasets.
Note: When you run the compound test with a Dataset Mapper, the test picks up the dataset values from the first row. For the test to pick up all the dataset values, you must put the test in a loop.

Procedure

  1. Open the UI Test perspective in HCL OneTest UI if it is not already open.
  2. Right click on the project from the Test Navigator pane and perform the following actions:
    1. Go to New > Compound test.

      The New Compound Test pane is displayed.

    2. Enter a file name for the test, and then click Finish.
    3. Click Finish.

      The file extension testsuite is added to the file name and the compound test is created under Compound Tests folder of the selected project.

  3. Click Add in the Compound Test window, and then select Test.
    The Select Tests window is displayed with all the projects in workspace.
  4. Select the functional test that has a dataset for linking a new dataset.
  5. Click OK.
    The test is added to the compound test.
  6. Save the compound test by clicking File > Save.
  7. Click Add > Dataset Mapper in the compound test editor.
  8. Select a dataset to use for the test in the Select Dataset dialog, and then click OK.
    In the Columns mapping table, the Column is automatically filled with the column names from the dataset. By default, the variable names are also created with the same names as the dataset columns.
  9. Click the cell in the Columns mapping table, and then click the Ellipsis button Ellipsis button and select the variable if you want to use the variable names from the test.
  10. Optional: Click Browse and select another dataset in Dataset Mapper Details if you want to change the dataset after it is associated.
  11. Select the Dataset Mapper, and then click Insert > Loop to fetch all the dataset values by using a loop.
  12. Save the changes.

Results

You have linked datasets to a functional test script to override the existing dataset.