Tutorial: Learning to Create Java Custom Toolkit Support > Learning to Support a Custom Static-Text Control > Planning Support for the ImageLabel Control

Planning Support for the ImageLabel Control

In this section, you analyze the current UFT support of the ImageLabel control and the adjacent text box, determine how you want UFT to recognize the controls, and fill in the Custom Class Support Planning Checklist, accordingly.

  1. Open UFT and load the Java Add-in and the custom toolkit support.

    1. Open UFT. The Add-in Manager dialog box displays ImageControls (for which you created support in the previous lesson) as a child of the Java Add-in in the list of available add-ins. (If the Add-in Manager dialog box does not open, see the Micro Focus Unified Functional Testing Add-ins Guide for instructions.)

    2. Make sure that the check boxes for both Java and ImageControls are selected, and click OK.

  2. Run the SampleApp application.

    In the Eclipse Package Explorer tab, right-click SampleApp. Select Run As > Java Application. The SampleApp application opens:

  3. Use the Object Spy to view the ImageLabel properties.

    1. In UFT, open a GUI test and select Tools > Object Spy or click the Object Spy toolbar button to open the Object Spy dialog box. Click the Properties tab.

    2. In the Object Spy dialog box, click the pointing hand , then click the image on the left in the SampleApp application.

    3. The ImageLabel control is based on a custom class that UFT does not recognize. Therefore, it recognizes the button as a generic JavaObject object named ImageLabel, and the icon shown is the standard JavaObject class icon. The label identification property is empty:

  4. Use the Object Spy to view the text box properties.

    1. In the Object Spy dialog box, click the pointing hand , then click the text box in the SampleApp application.

    2. The text box is based on a standard TextField class; therefore UFT recognizes it as a JavaEdit test object. However, the label identification property is empty and UFT does not recognize any adjacent controls as static-text controls. Therefore, the JavaEdit test object is named according to its class name—TextField:

    3. Close the Object Spy.

  5. Complete the custom class support planning checklist.

    The ImageLabel control is a static-text control. You want UFT to recognize this fact, and use the ImageLabel's label property as attached text for adjacent controls that do not have their own label property.

    The ImageLabel displays an image file optionally accompanied by additional text. When the control does not display any text, the name of the test object that represents the control can be based on the name of the image file that the control displays.

    The ImageLabel itself does not have any additional identification properties or test object methods that need to be identified in UFTGUI tests. In addition, there is no need to record any operations on the ImageLabel control.

    You can see the checklist, completed based on the information above.