Overview      

You need to write JavaScript functions in the course of creating a toolkit support set. This overview explains the place of JavaScript functions in the context of your toolkit support set. For more details, see the UFT Web Add-in ExtensibilityDeveloper Guide.

Definitions

Custom Web Control or Custom Control. An HTML element in a Web application that, together with its sub-elements, provides a distinct logical functionality or set of functionalities and properties. A custom control can contain other controls. Whether to handle a control individually or to view it as part of an aggregate control is a design issue to be decided when creating the toolkit.

For example, a DIV element that contains a text box, an OK button and a Cancel button might be a custom control.

Root element. The top-level, or containing element of a control. In the example above, the DIV element is the root element.

Test Object Class. A class within UFT One that represents controls having a common set of functionalities and properties. A test object class defines a number of characteristics, including the events to which the test objects of the class respond during test recording, the naming of individual test objects, the operations that can be used with the test objects, and the identification properties. For identification properties, the class defines:

    • the list of identification properties that the class supports.
    • the subset of those identification properties used to uniquely identify a control.
    • the identification properties available for checkpoints and output values.

Some of these classes are built-in to UFT One and some are provided by an add-in or custom toolkit support set.

Test Object. An instance of a test object class within UFT One that represents a single control instance in the application. When UFT One learns an application, it creates a test object for each application control. If the application control can be identified as belonging to a test object class, a test object of that class is created. If not, a generic test object for the relevant environment is created. For example, in Web applications, the generic object is WebElement.

Toolkit. A set of controls.

Toolkit Support Set. A set of files you create that instructs UFT One on how to create test objects for the controls in a toolkit, how to record events on those controls, and how to execute operations on the controls during test run.

Back to top

Elements of a Toolkit Support Set      

A toolkit support set is made up of:

The Test Object Configuration File contains the ID (name) of the toolkit, the name of UFT Add-in to which the toolkit applies, and the definitions of the test object classes. The toolkit name is also referred to as the environment name. This file helps UFT support the custom controls in the user interface. For example, the list of operations that can be performed on a custom control comes from this file.

The Toolkit Configuration File provides the implementation details for the custom support. For example, object identification, recording, and run-time operations. These details can be contained in this configuration file or in JavaScript files referenced from this configuration file.

JavaScript files that contain the implementations of the methods and properties mandated in the toolkit configuration file.

Icon files. (optional)

Help files. (optional)

Back to top

Extensibility Flow      

When UFT starts, it reads the class definitions from the test object configuration files and creates the working set of classes defined in all such files in addition to built-in classes and classes provided by the Web Add-in.

Whenever UFT needs to identify the objects on a page, it matches each control with one of the test object classes in the working set.

During a recording session, UFT listens for events on controls on the page and uses the configuration information and JavaScript functions from the toolkit to translate the events into test steps.

During a test run, UFT uses the information from the toolkit configuration file along with built-in information to execute operations on the controls on the web page.

Back to top

Uses of JavaScript Functions      

JavaScript functions are called to perform different tasks:

When learning the objects on a page or a learning a particular object, UFT may call identification functions and filter functions to match controls to test object classes. Objects can be learned during recording and test run. Some of the identification functions are also called when using the Object Spy. For more details, see Identification and Filter Functions.

During a recording session, UFT calls the functions defined in the Record\EventListening elements of the toolkit configuration file to set up the event handlers. These event handlers are then called to translate events to test steps. For more details, see Event Handling.

During a test run, UFT executes operations on controls by calling the methods specified in the toolkit configuration file. For more details, see Test Object Operations.

UFT can also call general functions that the toolkit implements. These functions are:

  • A function to get the base element
  • A function to retrieve the value of an identification property, by default called get_property_value
  • A function to retrieve a dynamic list of values, by default called get_list_of_values

For more details, see General Test Object Functions.

Back to top