Mapping a Custom Control to a Test Object Class

The test object class that is mapped to a custom control determines the identification properties and test object methods that UFT uses for the control. The values and behavior of these properties and methods are determined by support methods implemented in the custom control's support class.

You can map the custom control to an existing test object class that has all of the identification properties and test object methods relevant to the custom control. Alternatively, you can create a new test object class definition (in a test object configuration file) and map the custom control to the new test object class.

Each new test object class is based on an existing one, extending its set of identification properties and test object methods. All test object classes extend the JavaObject class. If an existing test object class definition includes some, but not all, of the identification properties and test object methods that you need, create a new test object class that extends it. (It is not recommended to add identification properties and test object methods to an existing test object class because that would affect all of the test objects of this class.)

You map the custom control to a test object class by implementing the to_class_attr method in the support class, to return the name of the relevant test object class. If the test object class returned by the inherited to_class_attr method is appropriate for the custom control, you do not have to override the to_class_attr method in the new support class.

The to_class_attr method provides the value for the Class Name identification property. When UFT learns an object, it finds the support class to use for this object, as described in Understanding the Hierarchy of Support Classes. UFT then uses the Class Name identification property to determine which test object class is mapped to this control. UFT then uses this test object class name to find the test object definition, which can be taken from either an existing UFT test object, or from a new test object configuration file that you create.

For more information, see Understanding the Test Object Configuration File.