Design test object class operations

This task describes how to define, implement, and debug the operations that your test object class supports.

Note: This task is part of a higher-level task. For details, see Create or update support for a single control.

Define the list of operations

Define the list of operations supported by this test object class.

In the Operations tab (Test Object Class designer), do the following:

  • Add or remove operations, or select base class operations to override.

    Keep in mind that if the following conditions are met, you need to override all of the base class operations that are not supported by the WebElement test object class:

    • The control you are supporting is not represented by the type of HTML element supported by the base class.

    • You did not implement a get base element function that returns such an element to UFT One.

  • In this case, operations that you do not override are available when editing tests, but are not implemented. Including these operations in test steps results in run-time errors. For more details, see the section on extending an existing test object class in the UFT One  Web Add-in Extensibility Developer Guide.

  • For operations that you add or override, define the method signature and optionally, additional information.

  • Specify the default operation for this test object class (optional).

    If you do not select a default operation, the base class's default operation is used.

  • How these definitions affect the files:

  • The information defined in this tab is stored in the toolkit support set XML files.

  • JavaScript function stubs for new operations are added to the relevant JavaScript file.

  • JavaScript function signatures for operations whose signature you modify are updated.

  • JavaScript functions for deleted operations are not removed from the JavaScript file.

    Note: If you define the Implementation file name or Implementation function name advanced options, Extensibility Accelerator does not manage the JavaScript implementation functions. This means the function stub is not added to the file, and the function's signature is not updated when you modify the operation's signature, or the Implementation function name option.

  • For more details, see When changes are applied and saved.

Back to top

Design the operations' JavaScript functions

Design the JavaScript functions that implement the test object operations.

  1. In the Operations tab (Test Object Class designer), select the relevant operation and click the Implementation Code button. The JavaScript file opens to the relevant JavaScript function in a JavaScript Editor.

    Alternatively, you can open the relevant JavaScript file by double-clicking it in the Project Explorer.

    By default, the name of the JavaScript file is <test object class name>.js, and the name of the function you need to implement is the same as the test object operation name. You can modify these names in the advanced options in the Operations tab (Test Object Class designer). If you update the function name in the designer or in the JavaScript file, make sure to update it in the other location as well.

  2. Implement the JavaScript functions to perform the test object operations on the control. For details, see the section on implementing support for test object methods in the UFT One  Web Add-in Extensibility Developer Guide.

    You must implement JavaScript functions for all new and overridden operations.

Back to top

Test and debug the operations

For details, see Test and debug your test object operation support.

Back to top