Supporting Identification Properties

The identification properties of a custom control are defined in the test object class. This can be an existing UFT One test object class or one you define in a test object configuration file.

Support for the identification properties is provided in the support class by implementing a method with the following signature for each identification property:

public String <identification property name>_attr(Object obj)

The method name must contain only lowercase letters (even if the property name in the test object configuration file contains uppercase letters). The obj argument is the object that represents the custom control.

Within the method, you return the value of the required property by using the custom class's public members. (Note that the support class can access only those custom class members that are defined as public.)

For example, the width_attr method implements support for a width identification property:

public String width_attr(Object obj) {
    return Integer.toString(((Component) obj).getBounds().width);

When your support class extends the support class of a functionally similar control, you do not have to implement support for those identification properties that apply without change to the custom control. For example, many controls have a label property. If the implemented support of the label property adequately supports the custom control, you do not need to override the parent's method.

You might inherit (or create) support methods for identification properties that are not included in the test object class definition. These identification properties are not displayed in UFT One in the Object Spy or in the Checkpoint Properties dialog box. You can access these identification properties by using the GetROProperty method. For more information on the GetROProperty method, see the Micro Focus UFT One Object Model Reference for GUI Testing.

To support identification properties of the custom control that are not supported by the parent support class, add new methods in your support class. To support identification properties that have the same name as supported ones, but a different implementation, override the parent methods.

See also: