New UFT One Custom Static-Text Support Class Wizard
You use the New UFT One Custom Static-Text Support Class wizard to create a support class for a custom static-text class within a Java Add-in Extensibility project. Supporting a static-text class enables UFT One to use its label property as the attached text for an adjacent control.
Overview
The only thing that you need to specify in this wizard is which custom class you want to support as a static-text class (and the controls of this class represent top-level objects, if relevant). The wizard creates the new support class with the methods required for the support of static-text objects. These methods are described in Custom Static-Text Support Class Summary Screen.
After the wizard creates the new support class, you complete its implementation as described in Completing the Custom Static-Text Class Support.
In most cases, it is not necessary to support any additional identification properties or test object methods for a static-text control. However, after the wizard creates the new support class, you can add additional methods to the class, providing support for additional identification properties or test object methods, or for recording. You can add these methods manually, or by using the commands described in Working with UFT One Commands in Eclipse.
Open the New UFT One Custom Static-Text Support Class wizard
In the Eclipse Package Explorer tab, select a UFT One Java Add-in Extensibility project. Then select File > New > Other. The New dialog box opens.
Expand the UFT One folder and select UFT One Custom Static-Text Support Class.
Click Next. The Custom Static Text Class Selection Screen opens.
Tip: You can shorten this process by customizing Eclipse to provide UFT One Custom Static-Text Support Class as an option in the New menu. To do this, perform the following: Select Window > Customize Perspective. In the Shortcuts tab in the dialog box that opens, select the UFT One and UFT One Custom Static-Text Support Class check boxes. Click OK.
Custom Static-Text Class Selection Screen
The options in the Custom Static-Text Class Selection screen are identical to the options in the Custom Class Selection Screen. When you click Finish, the Custom Static-Text Support Class Summary Screen opens.
Select the custom class you want UFT One to recognize as static-text and set the relevant options.
Static-text controls do not normally have any identification properties or test object methods that are relevant for UFT One GUI tests. Therefore, no additional specifications are required in this wizard.
Custom Static-Text Support Class Summary Screen
Before the wizard creates the custom support class file, the Custom Static-Text Support Class Summary screen summarizes the specifications you provided for the new support class.
If you want to change any of the data, click Cancel to return to the Custom Static-Text Class Selection Screen.
If you are satisfied with the definitions, click OK. The wizard creates the new support class with the following methods, which are required for the support of static-text objects:
class_attr. Returns the string
static_text
, enabling UFT One to recognize objects of this class as static-text controls.label_attr. Returns the label property of the superclass.
When the label property for a Java control is empty, UFT One looks for an adjacent static-text control and uses its label property for the test object name. Therefore you may want to implement the label_attr method to return the appropriate name, for example, the string displayed by the static-text control.
tag_attr. Returns the tag property of the superclass (which returns the label property value) with the suffix
(st)
. This method provides the test object name for the static-text control itself, while the label_attr method provides the name used for adjacent controls.For example, if you implement the label_attr method to return
MyButton
, the tag_attr method returnsMyButton(st).
For more information, see Common Identification Property Support Methods.
value_attr. Returns the label property.
The value property represents a control's test object state. For static-text controls, the label property adequately represents this state.
You can practice creating support for a custom static-text control in the tutorial lesson Learning to Support a Custom Static-Text Control.
Completing the Custom Static-Text Class Support
After you finish creating a custom support class for a custom static-text class (using the New UFT One Custom Static-Text Support Class Wizard), you need to perform the following additional steps:
Save the class.
In Eclipse, the new class file is opened and displayed in a tab in the right pane. Until you save the class, an asterisk (*) is displayed in the tab next to the support class file name. The changes made by the wizard are codependent and need to be saved to prevent discrepancies.
Implement the label_attr method, if needed.
Deploy the toolkit support to UFT One to enable the support to be available. For more information, see Deploying and Running the Custom Toolkit Support.
See also: