Configuring which test object class to use for a custom web control

After you define the test object classes that you want to use to represent your controls, you need to map each type of control to a specific test object class.

This identification can be performed using JavaScript functions or condition elements that check the control's properties and determine the test object class that should represent it. To improve the performance of learning custom controls and running steps on them, define the identification elements in such a way that JavaScript function calls are avoided as much as possible.

You can limit the identification process of custom controls to HTML elements with HTML tags you specify. This can further improve performance, and is more efficient than defining conditions that check the tagName property.

You provide information enabling OpenText Functional Testing to identify which test object class to use for the different controls in the Controls\CommonIdentification element in the toolkit configuration file, or in the Control\Identification element. In these elements you can define the following:

  • A set of HTML tags per test object class. When OpenText Functional Testing handles each control, it continues the identification process according to the definitions in the Identification element, only for HTML elements with the specified HTML tags.

  • A set of conditions per test object class. When OpenText Functional Testing handles each control, OpenText Functional Testing checks the control's HTML properties against the conditions you define in each Control element, and locates the first one whose conditions the control meets.

    Note: You can define different conditions and HTML tags for OpenText Functional Testing to use when running on different browsers.

  • One JavaScript identification function for the whole toolkit. When OpenText Functional Testing handles each control, OpenText Functional Testing calls this function, which checks the control's properties and returns the name of the appropriate test object class.

    Note: If you specify an identification function at the toolkit level (in the Controls\CommonIdentification element) and also conditions at the test object class level (in the Control\Identification element), OpenText Functional Testing checks the conditions before calling the JavaScript function, to avoid unnecessary calls.

  • A JavaScript identification function per test object class When OpenText Functional Testing handles each control, OpenText Functional Testing calls each of these JavaScript functions, in the order in which the test objects are defined in the toolkit configuration file. Each function checks whether the test object class for which it is defined should represent the control. OpenText Functional Testing uses the first test object class whose function returns true.

    This method of identification should be avoided if possible because it significantly affects performance, as it involves many calls to JavaScript functions for each control.

    Note: If you specify an identification function at the toolkit level (in the Controls\CommonIdentification element), OpenText Functional Testing does not call any identification functions specified at the test object class level (in the Control\Identification element).

  • You can also combine the use of conditions and JavaScript functions, defining conditions that limit the calls to the JavaScript function you define, based on the control's properties. For more information, see Using the Conditions Elements.

For more information on writing JavaScript functions for Web Add-in Extensibility, see Designing JavaScript functions for your toolkit support set.

For information on the structure and syntax of the identification elements, see the Toolkit Configuration Schema Help.

After you teach OpenText Functional Testing to identify the test object class to use for the custom control, you can test the basic functionality of your toolkit support set. For more information, see Testing the Toolkit Support Set During Development.