Navigate within a data source

Relevant for: API testing only

When using data in an API test, UFT provides different options to enable using customized selection of the data.

What is data navigation?

When running a test, data is stored in multiple sources and is used in different step properties. In these cases, use the Data Navigation Dialog Box to instruct UFT One:

  • how to use the data sources, including where in the data source to begin calling data values.

  • how to navigate through the data source

  • where to stop using values from the data source

Data navigation properties enable you to continue to add data to a data source while the data source is used in a test. For example, if you add new data to a data source, but the new data is not complete, instruct UFT One to begin at the row containing the old data and stop before calling the new data values.

Back to top

Parent/Child data source relations

If your test uses multiple data sources to provide data for your test step properties, create a hierarchy of relations between data sources. Use data relations when you use one specific data source as the primary data source for a test but require other data sources to populate property values within the same test.

You assign the primary data source to the Test Flow or selected test loop. Then, in the Define New Data Relation dialog box, specify any child data sources and map the columns of the parent data source to the columns of the child data source.

When the test runs, UFT One substitutes the child data as specified.

Back to top

Add a data source to the Test Flow or test loop

  1. Associate the necessary data sources with your test.

  2. In the canvas, select the Test Flow or another test loop.

  3. In the Properties pane, select the Data Sources tab . The list of all currently associated data sources is displayed.

  4. In the Data Sources tab, click Add. The Attach Data Source to Loop Dialog Box opens.

  5. In the Attach Data Source to Loop dialog box, select the data source to add to the loop and click OK.

    The selected data source is now added to the loop and you can use it to link property values.

    If the selected Test Flow or loop is set as a ForEach type, the test runs the same number of iterations as the number of rows specified.

    If the data is not designated as the data source for the loop, but contains values used in steps within the loop, the data navigation policy indicates the order in which the values are called from the data source. For example, if you specify to begin in the second row of your Excel data source, UFT One populates the property value with the values from the second row.

Back to top

Specify the navigation properties for the data source

  1. In the canvas, select the Test Flow or other test loop.

  2. In the Properties pane, open the Data Sources tab . The list of data sources associated with the current loop is displayed.

  3. In the Data Sources tab, click Edit. The Data Navigation Dialog Box opens.

  4. In the Data Navigation dialog box, specify the Start and End rows.

  5. Indicate the direction in which to move when retrieving data from the table, Forward or Backward, and the number of rows by which to advance for each iteration. Alternatively, you can indicate to move to a random row.

  6. Specify the action to do when reaching the last row- Wrap around or Keep using that row. Click OK.

  7. Back to top

Create a new child relation

This step enables you to specify parent-child data source relations between multiple data sources. You can use parent-child relations for Excel, Local Table, and Database type data sources.

  1. Add at least two or more Excel, Local Table, or Database data sources.

    Note: This can also be a single Excel file with two worksheets.

  2. In the Data pane, select the data source that you want to designate as a parent.

  3. In the Properties, open the Data Source Properties Tab (Properties Pane - API Testing).

  4. Click the Add button. The Define New/Edit Data Relation Dialog Box opens.

  5. Specify the details of the new relation:

    • The data source to use as the child data source

    • The primary key - the data column in the parent data source

    • The foreign key - the data column in the child data source. This column is used in place of the primary key column in the parent data source when running the test.

    Click OK after specifying the data source details. The data relation is displayed in the Data Source Properties tab for the parent data source.

Back to top