You can get a single property value for the selected object while you are recording. It puts a getProperty into your script and returns the value during playback.
This information is useful if you need to make a decision based on the property. For example, you might want to query whether a button is enabled.
To get a property:
In Functional Tester, Java Scripting, click the Record a Functional Tester Script button or the File > New > Functional Test Script Using Recorder menu command to start recording a script. See Recording a Script in Functional Test, Java Scripting for more information. In Functional Tester, Java Scripting, click the Record a Functional Tester Script button or the File > New > Add Script Using Recorder menu command to start recording a script. See Recording a Script in Functional Test, VB.NET Scripting for more information.
In the Recording Monitor, click the Start Application button to start your test application. See Starting Your Test Applications for more information.
Locate the object in your application that you want to get a property for.
In the Functional Tester Recording Monitor, click the Insert Verification Point or Action Command button.
On the Select an Object page of the Verification Point and Action Wizard, use the Object Finder to select the object in your application. See the Select an Object page for more information about selecting objects. Once you have selected the object, click Next.
On the Select an Action page, click the Get a Specific Property Value option, which is the third option on the page. Click Next.
When you selected the object, the property list was automatically created and displayed in the Property Name and Value fields on the Insert getProperty Command Page. Select the property that you want to get. Click Next.
On the Variable Name page, verify the information listed in the Object, Property, and Data Type fields.
In the Variable Name field, accept the default suggestion listed in this box, or type a new name. The default name is based on the name of the object and the property you are testing.
The Declare the variable in the script option is selected by default. You need to declare a variable the first time you use the variable name. If you use the same variable name again in the same script, clear this option after the initial instance.
The examples in the next section show what the getProperty will look like in your script.
Click Finish.
The statement containing the getProperty will then be written into your script at the point you inserted it.
Examples
In Functional Tester, Java Scripting, if you get the label property on a button called Place Order, this is what would be written into your script:
String
PlaceOrder_label = (String)placeOrderButton2Button().getProperty("label");
In Functional Tester, VB.NET Scripting, if you get the enabled property on a button called Place Order, this is what would be written into your script:
Dim
PlaceOrder_enabled As Boolean = PlaceOrderButton.GetProperty("enabled")
Terms of use |
Feedback
(C) Copyright IBM Corporation 2002, 2004. All Rights Reserved.