Introducing UFT One Java Add-in Extensibility

Welcome to UFT One Java Add-in Extensibility.

UFT One Java Add-in Extensibility enables you to provide high-level support for third-party and custom Java controls that are not supported out-of-the-box by the UFT One Java Add-in.

About UFT One Java Add-in Extensibility

The UFT One Java Add-in provides built-in support for a number of commonly used Java objects. You use UFT One Java Add-in Extensibility to extend that support and enable UFT One to recognize additional Java controls. You can also use Java Add-in Extensibility to teach UFT One to recognize a group of controls as one object. For example, if a search button and an edit box comprise a search box, and you want UFT One to see them as one functional unit.

When UFT One learns an object in the application, it recognizes the control as belonging to a specific test object class. This determines the identification properties and test object methods of the test object that represents the application's object in UFT One.

UFT One can learn Java controls that are not supported out-of-the-box by the Java Add-in without using Extensibility. However, when UFT One learns a Java control that is not supported, it recognizes the control as a generic Java test object. This type of Java test object might not have certain characteristics that are specific to the Java control. Therefore, when you try to create test steps with this test object, the available identification properties and test object methods might not be sufficient.

For example, consider a custom control that is a special type of button that UFT One recognizes as a plain JavaObject. JavaObject test objects do not support simple Click operations. The JavaObject.Click method requires the coordinates of the click as arguments. To create a test step that clicks this custom control, you would have to calculate the button's location and provide the coordinates for the click.

Alternatively, consider a search box where pressing the search button searches for a string entered in the adjacent edit box. You would want to replace the button's Click operation with a more functional Search operation that uses text from another control.

By creating support for a Java control using Java Add-in Extensibility, you can direct UFT One to recognize the control or group of controls as belonging to a specific test object class, and you can specify the behavior of the test object. You can also extend the list of available test object classes that UFT One is able to recognize. This enables you to create tests that fully support the specific behavior of your custom Java controls.

Back to top

Identifying the Building Blocks of Java Add-in Extensibility

The sections below describe the main elements that comprise UFT One object support. These elements are the building blocks of Java Add-in Extensibility. By extending the existing support of one or more of these elements, you can create the support you need to create meaningful and maintainable tests.

Back to top

Deciding When to Use Java Add-in Extensibility

The UFT One Java Add-in provides a certain level of support for every Java control. Before you extend support for a custom Java control, analyze it from a UFT One perspective to view the extent of this support and to decide which elements of support you need to modify.

When you analyze the custom control, use the Object Spy, Keyword View, Editor, and the Record option. Make sure you examine each of the elements described in .

If you are not satisfied with the existing object identification or behavior, your control is a candidate for Java Add-in Extensibility, as illustrated in the following situations:

  • UFT One might recognize the control using a test object class that does not fit your needs. You can use Java Add-in Extensibility to map the custom class to another existing test object class or to a new test object class that you create.

  • The test object class mapped to the control might be satisfactory, but you would like to customize the behavior of certain test object methods or identification properties. You can use Java Add-in Extensibility to override the default implementation of these properties and methods with your own custom implementation.

  • You may find that the test object names UFT One generates for all controls of a certain Java class are identical (except for a unique counter) or that the name used for the control does not clearly indicate the object it represents. You can use Java Add-in Extensibility to modify how UFT One names test objects for that Java class.

  • UFT One may identify individual sub-controls within your custom control, but not properly identify your main control. For example, if your main custom control is a digital clock with edit boxes containing the hour and minute digits, you might want changes in the time to be recognized as SetTime operations on the clock control and not as Set operations on the edit boxes. You can use Java Add-in Extensibility to treat a custom control as a wrapper object for the controls it contains. UFT One does not learn the individual controls contained in a wrapper object.

  • During a record session, when you perform operations or trigger events on your control, UFT One may not record a step at all, or it may record steps that are not specific to the control's behavior. Alternatively, UFT One may record many steps for an event that should be considered a single operation, or it may record a step when no step should be recorded. You can use Java Add-in Extensibility to modify the events to listen for and the test steps to record for specific events.

For an example illustrating how to use Java Add-in Extensibility to improve UFT One support of a custom control, see Analyzing the Default UFT One Support and Extensibility Options for a Sample Custom Control.

Back to top

Next steps: