| Article Index |
|---|
| IBM Rational robot Creating Verification Points in GUI Scripts |
| Page 2 |
| All Pages |
Creating Verification Points in GUI Scripts
This chapter provides conceptual information about verification points and tells you how to perform common operations associated with creating a verification point. It includes the following topics:
Creating Verification Points in GUI Scripts
This chapter provides conceptual information about verification points and tells you how to perform common operations associated with creating a verification point. It includes the following topics:
-
About verification points
-
Types of verification points
-
Before you create a verification point
-
Tasks associated with creating a verification point
-
Working with the data in data grids
-
Editing a verification point
NOTE: For detailed information about each verification point and how to create it, see the Robot Help.
About Verification Points
A verification point is a point in a script that you create to confirm the state of an object cross builds of the application-under-test.
Verification Points and Data Files
During recording, a verification point captures object information (based on the type of verification point) and stores it in a baseline data file. The information in this file becomes the baseline of the expected state of the object during subsequent builds.
When you play back the script against a new build, Rational Robot retrieves the information in the baseline file for each verification point and compares it to the state of the object in the new build. If the captured object does not match the baseline, Robot creates an actual data file. The information in this file shows the actual state of the object in the build.
After playback, the results of each verification point appear in the TestManager log.If a verification point fails (the baseline and actual data do not match), you can select the verification point in the log and click View > Verification Point to open the appropriate Comparator. The Comparator displays the baseline and actual files so that you can compare them.
Verification Points and Scripts
A verification point is stored in the project and is always associated with a script. When you create a verification point, its name appears in the Asset (left) pane of the Script window. The verification point script command, which always begins with Result=, appears in the Script (right) pane.

NOTE: The following verification points are not stored in the project and do not appear in the Asset pane: File Comparison, File Existence, Module Existence, Window Existence, and Alphanumeric (if the verification method is Numeric Equivalence or Numeric Range).
Because verification points are assets of a script, if you delete a script, Robot also deletes all of its associated verification points.You can easily copy verification points to other scripts if you want to reuse them. For information, see Copying a Verification Point on page 4-26.
NOTE: You cannot play back a verification point that you have copied or typed into a .sbl library source file. The verification point must be in a script or a .rec library source file.
Types of Verification Points
The following table summarizes each Robot verification point.



NOTE: For detailed information about each verification point and how to create it, see the Robot Help.
NOTE: You can also verify objects through your own custom procedures. You can then use the SQABasic verification point management commands to perform the same kind of verification and logging tasks that Robot performs automatically. For more information, see the SQABasic Language Reference.
Before You Create a Verification Point
Before you create a verification point, consider the following:
-
What feature in the application do you want to test?
Example: You want to verify that the Cut command places selected data on the Clipboard.
-
To test the feature, what object or objects should you test?
Example: The objects that you should test are the Cut command on the Edit menu and the data on the Clipboard.
-
What kind of verification points do you want to create?
Example: You create verification points to test that 1) the Cut command exists on the Edit menu and is enabled, and 2) the Clipboard contains the information cut to it.
-
What type of verification points do you create to accomplish the kind of object testing that you want?
Example: You create a script that contains two verification points - an Object Data verification point to test that the Cut command exists on the Edit menu and that the state of the Cut command is enabled; a Clipboard verification point to test that the selected information is actually placed on the Clipboard.
Tasks Associated with Creating a Verification Point
The following table provides an overview of the major tasks that you perform when you create a verification point and where to look in this chapter for instructions. The specific steps depend on the type of verification point that you create.


Starting to Create a Verification Point
The following is the basic procedure for starting to create a verification point:
1. Do one of the following:
- If recording, click the Display GUI Insert Toolbar button on the GUI Record toolbar.
- If editing, position the pointer in the script and click the Display GUI Insert Toolbar button on the Standard toolbar.
2. Click a verification point button on the GUI Insert toolbar.

NOTE: To insert a File Comparison, File Existence, or Module Existence verification point, open the Robot window (click the Open Robot Window button on the GUI Record toolbar). Click Insert > Verification Point and the appropriate menu command.
3. In the Verification Point Name dialog box, edit the name as appropriate. The name can be a maximum of 20 characters.

4. Optionally, set the Wait state options. For information, see the next section, Setting a Wait State for a Verification Point.
5. Optionally, set the Expected result option.
6. Click OK.
The steps that you perform next depend on the type of verification point that you are creating. For a list of verification points, see Types of Verification Points on page 4-3. For detailed information about each verification point and how to create it, see the Robot Help.
Setting a Wait State for a Verification Point
When you create a verification point, you can add specific wait values to handle time-dependent test activities. Wait values are useful when the application requires an unknown amount of time to complete a task. Using a wait value keeps the verification point from failing if the task is not completed immediately or if the data is not accessible right away.
For example, suppose you create an Alphanumeric verification point that tests for a specific string in a text box. When you play back the script, Robot first looks for the text box. The verification point fails immediately if the box does not exist. If Robot finds the box, it checks for the string in the box. However, the string might not be in the box yet (your application might be running slowly and the box might not be updated yet). To solve this, include wait values so that Robot retries the test (checks for the string) every two seconds. If the content of the box does not match the string within 30 seconds, the verification point returns a failure indication to the script.
-
For verification points that verify the properties or data of an object, Robot must first find the specified object before it can perform the verification point. After it finds the object, the following happens:
-
If no wait state is specified, the verification point passes or fails immediately.
-
If a wait state is specified, then Robot does the following, as shown in this pseudocode example:loop until timeout period expires (as specified by Timeout After) wait for retry period (as specified by Retry Every) perform VP if it passes, exit loop, else loop back end loop
To add a wait state when creating a verification point:
1. Start to create the verification point.
2. In the Verification Point Name dialog box, select Apply wait state to verification point.
3. Type values for the following options:
Retry every - How often Robot retries the verification point during playback. Robot retries until the verification point passes or until the time-out limit is eached.
Timeout after - The maximum amount of time that Robot waits for the verification point to pass before it times out. If the time-out limit is reached and the verification point has not passed, Robot enters a failure in the log. The script playback either continues or stops based on the setting in the Error Recovery tab of the GUI Playback Options dialog box.
Setting the Expected Result for a Verification Point
-
When you create a verification point, the expected result is usually that the verification point will pass. For example, if you create a Window Existence verification point, you are usually expecting that the window will exist during playback. If the window exists, the verification point passes.However, suppose you want to test that a window does not exist during playback. This is useful when you want a script to wait for a window to disappear before continuing. In this example, you could create a Window Existence verification point with the following values:
-
A timeout wait state value of 30 seconds
-
An expected result of Fail
Because the expected result is a failure, you are telling Robot that you expect the window not to exist within 30 seconds. When you play back this verification point, if the window cannot be found at any time during the 30 seconds, the verification point passes. If the window is found during the 30 seconds, the verification point fails.
To set the expected result when creating a verification point:
1. Start to create a verification point. (See Starting to Create a Verification Point on page 4-7.)
2. In the Verification Point Name dialog box, click Pass or Fail.You might also want to add wait state values to the verification point. (See Setting a Wait State for a Verification Point on page 4-8.)
Selecting and Identifying the Object to Test
When you create certain verification points, you need to select the object to test. You do this by pointing to the object with the Object Finder tool or by selecting the object from a list of all objects on the Windows desktop.
When you point to an object, you can use one of several methods to visually identify the object before you actually select it.
Selecting the Object to Test
There are two ways to select the object to test:
-
Point to it in the application. This is useful for selecting visible objects.
-
Select it from a list of all objects on the desktop. This is useful for selecting hidden objects.
To select the object to test:
-
Start creating the verification point. (See Starting to Create a Verification Point on page 4-7.)
-
In the Verification Point Name dialog box, type a name, and click OK to open the Select Object dialog box.

3. Do one of the following:
- Select Automatically close dialog box after object selection to have the Select Object dialog box close after you select the object to test.
-Clear Automatically close dialog box after object selection to have the Select Object dialog box reappear after you select the object to test. You need to click OK to close the dialog box.
To select a visible object directly from the application, continue with step 4.
To select an object from a list of all objects on the desktop, skip to step 5.
4. To select a visible object directly from the application, drag the Object Finder tool over the object and release the mouse button.
When you drag the Object Finder tool, the Select Object dialog box disappears. When you release the mouse button, the Select Object dialog box reappears if you have cleared the Automatically close dialog box after object selection check box.
As you move the Object Finder tool over an object, the object type appears in a yellow TestTip.
5. To select a visible or hidden object from a list of all objects on the Windows desktop, click Browse to open the Object List dialog box. Select the object from the list and click OK.

The Object List dialog box includes hidden objects that you cannot point to because they are not visible through the user interface, such as objects with the Visible property set to False and objects with no GUI component. This dialog box also includes objects that are direct children of the desktop, such as PowerBuilder DataStore controls.When you select an object in the list and click OK, it is equivalent to pointing to the object with the Object Finder tool and releasing the mouse button.
NOTE: If you first select an object with the Object Finder tool (in step 4) and then click Browse, Robot highlights the selected object in the object list. The objects parent is expanded down to the level of the object. This is useful if there are many objects on the desktop. In this case, you would want to clear the Automatically close dialog box after object selection check box in the Select Object dialog box so that it reappeared after you selected the object.
| < Prev | Next > |
|---|