Data-driving functional tests
To data-drive a test script, you need to select the controls or objects in the application-under-test using either the Object Finder Tool method or the Test Object Browser method.
Before you begin
About this task
A dataset can be populated with data from the application. A dataset is a collection of related data records. A dataset supplies data values to the variables in a test script during test script playback.
You can use any of the following methods to select an object or a control:
- Object Finder Tool method -- Use this tool to select an object and
all descendents of the object, select one object, or select an object and the immediate
children of an object.Note:
- Test Object Browser method -- Use this method to browse for the object that you want to select. The browser displays a hierarchical tree of objects in your application. The top level shows any applications you have running. Under each top level, HCL OneTest™ UI displays the object hierarchy within that application. The hierarchical tree is a dynamic view of the currently available objects.
To data drive a test script:
Procedure
- Create a functional test project.
-
Start recording a test script.
-
Start the application you want to test and navigate through the application to the dialog
box that you want to data-drive.
-
Data-drive the test.
-
Under Populate then Select Test Objects, choose one of the following
methods:
- Press and drag hand to select test objects -- Use this method to select an object and all the descendents of the selected object. This is the most common and direct method of selecting an object.
- Use selection wizard to select test objects -- Click to use the Drag Hand Selection method with its options, or the Test Object Browser method. The Select Object to Data Drive page opens.
-
If you choose
Press and drag hand to select test objects, take the following
steps:
-
If you choose
Use selection wizard to select test objects, click the
Selection method arrow to select one of the following methods:
- Drag Hand Selection method -- Use this tool to include only the
selected object, the selected object and the immediate children of the selected object, or to
include the selected object and all descendents of the selected object. Note: The Drag Hand Selection method is not available on Linux environments such as Ubuntu and Red Hat Enterprise Linux (RHEL). You must use the Test Object Browser method on Linux environments.
- Test Object Browser method -- Use this method to browse for the object that you want to select.
- Drag Hand Selection method -- Use this tool to include only the
selected object, the selected object and the immediate children of the selected object, or to
include the selected object and all descendents of the selected object.
-
If you choose the Drag Hand Selection method, take the following
steps:
-
If you choose Test Object Browser method, take the following
steps:
- Optionally, in the Data Driven Commands table, under the Variable header, type a descriptive name for the name of each variable in the dataset.
-
Optionally, in the Data Driven Commands table, under the
Initial Value header, double-click the initial value, and then type in
a new initial value or click the arrow to select a new value from the list.
For example, you can change the initial value of a test object to test the non-default states of an application.
-
Optionally, in the Data Driven Commands table, make any of the
following changes.
- Click to move the selected row earlier in the order of execution in the Data Driven Commands table.
- Click to move the selected row later in the order of execution in the Data Driven Commands table.
- Click to delete a selected row from the Data Driven Commands table.
- Click to highlight a test object in the application-under-test. Select a test object in the Data Driven Commands table, and then click this icon.
- Click to display or hide recognition and administrative properties for a selected test object
- Click OK to finish data-driving the script. The Insert Data Driven Actions page closes and HCL OneTest™ UI populates a dataset with data collected from the application.
-
To finish recording the test script:
- You can add data to the dataset after you finish recording the test script. For more information about editing a dataset, see Editing datasets.