Use different data tables

Relevant for: GUI tests and scripted GUI components

When working with tests, the data table is saved with your test by default as an .xls or .xlsx file (or sometimes both). By default, UFT One uses the entered values for the test's data table when running the test.

However, when running a test, you can instruct UFT One to use different data tables/sheets than the ones saved with your test. For example, you can save the entered data table in another location and instruct the test to use this data table when running a test. You can also tell UFT One to use an external saved data table. You specify the data sheet name and location for the data table in the Resources pane of the Test Settings dialog box.

There are different scenarios in which you may need to save or access different data tables:

When to save or use a data table in a different location
  • If you want to run the same test with different sets of input values. For example, you can test the localization capabilities of your application by running your test with a different data table file for each language you want to test. You can also vary the user interface strings that you check in each language by using a different environment parameter file each time you run the test.

  • If you need the same input information for different tests. For example, you can test a Web version and a standard Windows version of the same application using different tests, but the same data table file.

When to save a run-time data table

If it is important for you to save the resulting data from the run-time data table, you can insert a DataTable.Export statement to the end of your test to export the run-time data table to a file. You can then import the data to the design-time data table using the data table's File > Import from File menu. Alternatively you can add a DataTable.Import statement to the beginning of your test to import the run-time data table that was exported at the end of the previous run session. For more details on these methods, see the DataTable object in the Utility Objects section of the UFT One Object Model Reference for GUI Testing.

When to save a run-time data table in ALM

When working with ALM, you must save the data table file in the Test Resources module in your ALM project before you specify the data table file in the Resources pane of the Test Settings dialog box. For more details, see Resources Pane (Test/Business Component Settings Dialog Box) .

You can add a new or existing data table file to your ALM project. Note that adding an existing data table file from the file system to an ALM project creates a copy of the file. Thus, once you save the file to the project, changes made to the ALM data table file will not affect the data table file in the file system and vice versa.