Data Driving a Test Script

To data-drive a test script, you need to select objects in the application-under-test. The data-driver populates a datapool with data from the application.

A datapool is a collection of related data records. A datapool supplies data values to the variables in a test script during test script playback.

You can use two methods to select an object:

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.

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, Functional Tester 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:

  1. Create a project to store the test assets you need to test an application.

  1. Start recording a test script.

  1. In the Select Script Assets dialog box, in the Datapool Record Selection Order box, select one of the following types of datapool record selection orders:

The Functional Tester window minimizes and the Recording Monitor opens.

  1. Start the application you want to test and navigate through the application to the dialog box that you want to data-drive.

    1. On the Recording toolbar, click Start Application (Starts an application) to start an application.

      See Starting Your Test Applications for more information. (If your application is already running, you do not need to do this step.)

    2. Perform any actions in the application that you want to record in the test script.

  2. Data-drive the test.

    1. On the Recording toolbar, click Insert Data Driven Commands (Inserts data driven commands).

      The test script recording pauses and the Insert Data Driven Actions page opens.

    2. In the application-under-test, type the initial values that you want to see in the datapool in the fields that you want to data drive.

By populating these fields while the recorder pauses, you do not record unnecessary actions in the test script. Any change to the control flow of the program while the test script recording pauses is not recorded in the test script.

    1. Under Populate then Select Test Objects, choose one of the following methods:

    1. Optionally, in the Data Driven Commands table, under the Variable header, type a descriptive name for the name of each variable in the datapool.

    2. 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.

    3. Optionally, in the Data Driven Commands table, make any of the following changes.

Moves selected row earlier in the commands table Click to move the selected row earlier in the order of execution in the Data Driven Commands table.

Moves selected row later in the commands table Click to move the selected row later in the order of execution in the Data Driven Commands table.

Deletes the selected for from the commands table Click to delete a selected row from the Data Driven Commands table.

Highlights the selected test object in the software under test 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.

Displays or hides recognition and administrative properties Click to display or hide recognition and administrative properties for a selected test object.

    1. Click OK to finish data-driving the script.

      The Insert Data Driven Actions page closes and Functional Tester populates a datapool with data collected from the application.

  1. Finish recording the test script.

    1. Perform any actions in the application you want to record.

    2. If you want to record a verification point, locate the object in your application you want to test, and then click the Insert Verification Point or Action Command button.

      Tip:
       Click the Help button while creating the verification point for more information on the Verification Point and Action Wizard, or see Creating a Properties Verification Point for an example of how to create a properties verification point.

      You can use a datapool reference instead of a literal value for the value you are testing in the verification point.

    3. If you want to insert any script support functions into the script, such as a call script command, log entry, timer, script delay command, or comment, click the Insert Script Support Commands button. Click the Help button in the Script Support Functions dialog box for information on these functions.

    4. Close your application, if you want closing the application to be part of the script.

    5. On the Recording toolbar, click Stop Recording (Stop Recording) to write all recorded information to the test script and update the datapool with new variables and associated initial values.

      The Functional Tester window opens and the script displays in the editor window.

  2. You can add data to the datapool after you finish recording the test script. For more information about editing a datapool, see Editing Datapools.

Related Topics:

Recording a Script

Insert Data Drive Actions Dialog Box

Select Script Assets Page

Terms of use | Feedback
(C) Copyright IBM Corporation 2002, 2004. All Rights Reserved.