Relevant for: GUI tests and scripted GUI components
Data table parameters enable you to supply a set of possible parameter values for a data-driven test, component, or action.
Data-driving instructs UFT One to run a test, component, or action several times using the data supplied by the table in the Data pane. Each test or action iteration uses the next row of values in the table as the parameter values.
Create a new data table parameter to add a new column to the end of the Data pane.
Any current value you've given to the parameter is entered into the first row of that column. If you parameterize a value using an existing parameter that already has values in the Data pane, those values are not overwritten.
The Data pane supports the following types of data table parameters:
|Global data table parameters||
Used in multiple actions across the test.
Having multiple rows in your Global data table sheet means that your entire test will run multiple times, once for each row.
For details, see Global data table parameters.
|Local data table parameters||
Used in a single action only.
Having multiple rows in a local data sheet means that the corresponding action will run multiple times before continuing on to the next action in the test.
For details, see Local data table parameters
Having multiple rows in both the Global and local data sheets means that each single test iteration runs multiple action iterations before continuing on to the next test iteration.
Tip: Use global data table parameters when you want the data to be available to multiple actions, and when you want subsequent iterations to use different data for a particular parameter.
Global data table parameters take data from the Global sheet in the Data pane, and can be used in any action.
By default, the test runs an iteration for each row in the sheet, however other options include:
- Setting your test to run only a single iteration with a selected row of data
- Setting your test to run iterations using specified rows of data only
Tip: Use global data table parameters to pass values from one action to another.
To do this, output values to the global sheet in the Data pane from the first action and then use them as input parameters in another action. For details, see Output Values in GUI Testing.
Local data table parameters take data from the action's sheet in the Data pane and apply only to that action.
By default, actions run only one iteration. To data drive your actions, configure specific calls to the action to run iterations for all rows in the sheet, or for specific rows only. Configure your action calls in the Run Tab of the Action Call Properties dialog box.
The following sample scenarios illustrate how you might use data table parameters in your test.
Searching a membership database
Suppose your application includes a feature that enables users to search for contact information from a membership database.
When the user enters a member's name, the member's contact information is displayed, together with a button labelled View <MemName>'s Picture, where <MemName> is the name of the member. Parameterize the name property of the button using a list of values so that during each iteration of the run session, UFT One can identify the different picture buttons.
Consider the Advantage Online Shopping sample Web site, which enables you to place and pay your orders. To buy all devices on your shopping list, you select the right models, adds them to the shopping cart, and click the Check Out button. The site returns the order number and shipping number.
Although you could conduct the test by accessing the Web site, adding the devices to the cart one by one, and paying them, this is a slow, laborious, and inefficient solution. By using data table parameters, you can run the test to perform all the actions at one time.
When you parameterize your test, you first create steps that access the Web site and check for the available device models.
You then substitute the existing add-to-cart and checkout actions with a data table parameter and add your own sets of data to the relevant sheet of the Data pane, one for each device model.
In this example, UFT One adds a device model to the cart and pay for it when you run the test.