Get 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

Prerequisites: The test application is started

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:


Procedure

  1. Click the Record a Functional Test Script button on the Functional Tester toolbar.

  2. In the Recording Monitor, click the Start Application button to start your test application.

  3. Locate the object in your application that you want to get a property for.

  4. In the Recording Monitor, click the Insert Verification Point or Action Command button.

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

  6. On the Select an Action page, click the Get a Specific Property Value option and click Next.

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

  8. On the Variable Name page, verify the information listed in the Object, Property, and Data Type fields.

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

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

  9. 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");


What to do next

Related tasks

Insert conditional statements

Related reference

Select an Object page of the Verification Point and Action Wizard

Insert getProperty Command page

Variable Name page of the Verification Point and Action wizard

Properties view - General page

+

Search Tips   |   Advanced Search