Add data sources to an API test

For details about data handling for GUI tests and the GUI testing Data Pane, see Data Pane.

Relevant for: API testing only

Add an Excel data source

  1. In the Data pane, click the New Data Source down arrow and select Excel. The New/Change Excel Data Source Dialog Box opens.

  2. Browse to the file and indicate if the first row is a header row.

  3. Specify a name for the data source. If you do not provide a name, UFT sets it to the Excel file name after you navigate to the file.

  4. Select whether to link to the Excel in its original location or create a local copy.

    The advantage of making a local copy is that it becomes portable with the test. However, any updates to the data at its original location will not be not reflected in the migrated test.

  5. Select Allow other tools to override the data option to enable ALM to run the test with different values.

    This allows you to overwrite the data from the imported Excel file with values from an ALM Data Resource. In addition, if you call a test or action with data assigned to its steps, this option allows you to edit the data in the called test or action.

  6. Click OK.

  7. In the Data pane, select the data source under the Excel node. In the right pane, you can view and edit the values.

    Caution: When entering values into the Excel sheet, you should use the Excel General format for values.

Back to top

Add an XML data source

  1. In the Data pane, click the New Data Source down arrow and select XML.

    The New XML Data Source Dialog Box opens.

  2. Provide a Data Source name.

  3. Select the entity upon which to base the data source:

    Schema file Browse to an .xsd file.
    XML file Browse to an .xml file.
    Use existing Browse to an existing XML-based data source from another test.
  4. Click OK.

  5. Select the data source's node in the Data pane.

  6. Edit the XML data in the grid. Click the Add rows button to add row values.

  7. To load XML values, click the Load data from an XML file button .

Back to top

Add a database data source

  1. In the Data pane, click the New Data Source down arrow and select Database. The Add New Database Data Source Wizard opens. The Set Database Connection page opens.
  2. In the Set Database Connection pane, add the database connection information as follows:

  3. In the Set SQL Statement page, provide a unique name for the data source, not used by another data source.

    Note: If you do not provide a name, the data source is automatically assigned the table name after you build the query.

    Then, provide an SQL statement in one of the following ways:

  4. In the wizard's Set SQL Statement page, click the Check SQL Statement button.

    After the Query Preview is finished, click Close to return to the wizard.

  5. Click Finish. UFT shows the query details in the Properties pane's Database Data Source Properties Tab (Properties Pane - API Testing).

    Note: By default the Data pane shows the first ten rows of the query data. To change the number of displayed rows, use the General Pane.

Back to top

Add a local data table

  1. In the Data pane, click the New Data Source down arrow and select Local Table. The New Local Table Data Source Dialog Box opens.

  2. Click the Add button to create a column in the data table.

  3. In the columns list, specify a column name and description. Select a data type from the drop down list.

  4. Repeat steps 3 and 4 for each column you want to create.

  5. When you are finished, click OK.

  6. In the Data pane, select the table's node in the left pane and move within the table using the keyboard arrows. Type within the cells to manually set values.

Back to top