Base Class selection

When you define a test object class in the General tab (Test Object Class designer), you define a base class—a test object class that your new one extends. By default, all Web test object classes extend WebElement.

The base class that you select determines the test object class' generic type and default operation (unless you define them specifically) and provides the following:

  • An initial set of test object operations, inherited from the base class. Some of these are displayed in the Operations tab, in which you can override them or add your own test object operations.

  • A list of identification properties that you can choose to include in your test object class. Some of these are displayed in the Properties tab, in which you can also add or modify identification property definitions.

  • If the control you are supporting contains the type of HTML element supported by the base class, your test object class also inherits the implementation that supports the inherited operations and properties. For details, see the section on extending an existing test object class in the UFT One  Web Add-in Extensibility Developer Guide.

Therefore:

  • Select a base class that provides operations and properties that are relevant to the behavior of the control you are supporting.

  • Make sure that the control contains an HTML element of the type supported by the base class. Otherwise, you need to provide implementation for all of the inherited test object operations and properties not supported by WebElement.

  • If the control you are supporting contains the type of HTML element supported by the base class, but this is not the element that represents the control itself, you must implement a JavaScript function that returns the relevant base element.