Define and manage data tables

Relevant for: GUI tests and scripted GUI components

Add an external data table file

  1. Select File > Settings to open the Test Settings dialog box.

  2. In the Settings dialog box, select the Resources node.

  3. In the Resources pane, in the Data Table section, select one of the following:

    • Default location: saved with the test in the same directory
    • Other location: click the Browse button and navigate to the directory where the external data table is stored.

      Note: If you select an external file as your data table, make sure that:

      • The values in the first row of the external data table match the parameter names in the test.

      • The sheet names in the external data table match the action names in the test.

Back to top

Manually enter information

Edit information in the Data pane by typing directly into the table cells, as you would do in an Excel worksheet.

Tip: To jump to a specific cell in the data table, enter its coordinates (for example G27) in the box in the top left corner of the pane.

  • Each row in the table represents the set of values that UFT One submits for the parameterized arguments during a single iteration of the test or action.

    The first row contains the parameter names.

  • Each column in the table represents the list of values for a single parameterized argument.

The data table displays only columns with a parameter name in the first row and one additional empty column in which you can add a new parameter.

To add or delete a column, right-click the column header and select Edit > Insert or Edit > Delete.

Back to top

Import information from a file

Do one of the following:

  • Right-click in the Data pane and select File > Import from File from the Data pane commands.

  • Right-click in the Data pane and select Sheet > Import > From File from the Data pane commands.

Note: You can also import data saved in Microsoft Excel, tabbed text file (.txt), or ASCII format.

Back to top

Import information from a database with MFA enabled

If the Multi-Factor Authentication (MFA) mode is enabled in your database, do the following to successfully import the information from your database to the data table:

  1. Download and install the latest ODBC driver (version 17) from the Microsoft ODBC Driver Download Site.

  2. Right-click in the Data pane and select Sheet > Import > From Database.

  3. In the Database Query Wizard, select Specify SQL statement manually.

  4. In the Specify SQL statement page that opens, specify the connection by using one of the following ways:

  5. Specify the SQL statement.

    You may be prompted to enter the credentials again if you choose to use a DSN file to specify the connection.

    After you enter the credentials, the database data is successfully imported to the data table in the Data pane.

Back to top

Add a data table file to your ALM project

  1. Make sure you have an accessible Microsoft Excel file with an .xls or .xlsx extension.

  2. In ALM, create a new data table resource and then upload the .xls or .xlsx file you created in the previous step to the project's Test Resources module.

  3. In UFT One, select File > Settings to open the Test Settings dialog box.

  4. In the Resources pane of the Test Settings dialog box, in the Data table section, select Other location and click the Browse button to locate the data table file.

  5. Enter your data as needed. When you save the test, UFT One saves the data table file to the ALM project.

Back to top

Define the number of iterations for an action or test

Do one of the following:

For actions
  1. In the canvas, right-click an action and select Action Call Properties. The Action Call Properties dialog box opens.

  2. In the Run tab of the Action Call Properties dialog box, select the appropriate option:

    • Run one iteration only

    • Run on all data rows - UFT One runs an iteration for each row in the action's data sheet

    • Run from data row <X> to data row <X> - UFT runs an iteration for each of the defined rows

For tests
  1. Select File > Settings to open the Settings dialog box.

  2. In the Run pane, select the appropriate option:

    • Run one iteration only

    • Run on all data rows - UFT One runs an iteration for each row in the action's data sheet

    • Run from data row <X> to data row <X> - UFT runs an iteration for each of the defined rows

Notes

  • Run on all data rows.

    If you want to prevent UFT One from running an iteration on a row when the Run on all data rows option is selected, you must delete the entire row from the data table.

  • Run from data row <X> to data row <X>.

    The first row in the data table contains the column names. Therefore, the data row number is always 1 lower than the row number in the data table display.

    For example, in the table below, Alex is listed in data row number 3, which is table row number 4.

Back to top

Change a parameter name in the data table

In the data pane, double-click the first row of a column and enter the new parameter name in the cell.

The first row in the data table represents data table parameter names, which must start with a letter or underscore (_) and contain letters, numbers, periods (.), spaces, dashes (-), or underscore (_) characters.

If you modify the parameter name in the data table, you must also:

  • Change the name of the corresponding data table parameter wherever it is used (for example, parameterized argument values, checkpoint or output values, action parameters, and repository parameters).

  • For tests stored in Micro Focus ALM: In the Test Plan module, you must also update the parameter mappings in each configuration defined for your test.

Back to top

Use an autofill list

You can use an autofill list to quickly populate columns or rows of data with predefined lists of values. Autofill lists are convenient for frequently-used series of text such as months and days of the week.

To create, edit, or delete an autofill list, right-click a cell in the Data pane, and select Data > Autofill to open the Autofill Lists Dialog box.

To populate your data table with values from an autofill list

  1. In a data table cell, enter an item from an autofill list (case-sensitive).

  2. Drag the cursor from the bottom right corner of the cell down or to the right to populate the next rows or columns in the sheet with the next items in the autofill list.

Note: If you enter a value that appears in multiple lists, UFT One uses the first autofill list in which this value appears.

Back to top

See also: