- Test Script Synchronization
- Placing a Generic Delay in Your Script
- Waiting for Test Objects to Come into Existence
- Timing How Long Something Takes to Execute in a Script
- Working with Test Objects
- Working with the Clipboard Object
- Viewing an Objects Properties
- Retrieving All Properties of a Test Object
- Retrieving the Value of a Single Property
- Programmatically Retrieving Data from an Object in My Application
- Determining a Test Objects Valid Test Data Type Arguments to getTestData()
- Using getTestData to Extract Data from a Text Field
- Using getTestData to Extract Data from a List
- Using getTestData() to Read Data in a Table
- Using getTestData() to Extract Data from a Tree
- Obtaining Data from a Test Object That the Rational Functional Tester Verification Point Wizard Does Not Capture
- Creating a Custom Verification Point
- Changing the Value of a Test Objects Property
- Evolving Custom Scripting into Reusable Methods
- Summary
Determining a Test Object’s Valid Test Data Type Arguments to getTestData()
You can use two techniques to determine a test object’s valid data type arguments:
- Call getTestDataTypes() on the test object you need to get data from. getTestDataTypes() is a method in the TestObject class that returns a Hashtable, which holds the same information that the Rational Functional Tester Verification Point Wizard displays (and then some).
- Right-click the test object in the Script Explorer, and click Interface Summary. This displays a page in the Rational Functional Tester documentation that summarizes how it works with the selected test object, including the valid data types it can use.
For example, if you invoke getTestDataTypes() on the Orders table in the Classics sample application (Admin > Orders) and print the returned hashtable to the console (Output window in Visual Studio), you have the following:
In Java:
System.out.println( orderTable().getTestDataTypes() );
In VB.NET:
Console.WriteLine(someTable.GetTestDataTypes)
You see something similar to what is displayed in Figure 3.21.
The keys in the hashtable (contents, visible contents, selected, and selected and visible selected) are the valid test data type arguments to getTestData() for the test object in question; the value of each hashtable key is a description (for you, not Rational Functional Tester) of the test data type. Based on that output, the following are all valid calls to make on the Orders table:
orderTable().getTestData( "contents" ); orderTable().getTestData( "selected" ); orderTable().getTestData( "visible contents" ); orderTable().getTestData( "visible selected" );