Getting a property value
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.
Before you begin
About this task
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.
Procedure
- Click the Record a Functional Test Script button on the product toolbar.
- In the Recording Monitor, click the Start Application button to start your test application.
- Locate the object in your application that you want to get a property for.
- In the 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. Once you have selected the object, click Next.
- On the Select an Action page, click the Get a Specific Property Value option and 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.
- Click Finish.
The statement containing the getProperty will then be written into your script at the point you inserted it.
Example
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)placeOrder().getProperty("label");