Working with UFT One Commands in Eclipse
After you install the UFT One Java Add-in Extensibility SDK, which includes the Java Add-in Extensibility Eclipse Plug-in, a toolbar with the following buttons is added to Eclipse:
Button | Definition | Button | Definition |
---|---|---|---|
Deploy Toolkit Support | Add Identification Property | ||
Reload Support Configuration | Add Test Object Method | ||
Delete Custom Support | Add Event Handler |
A new UFT One menu is also added to Eclipse, with these same commands. The commands are described in detail in the following sections.
The Deploy Toolkit Support command is available in Eclipse when you select a UFT One Java Add-in Extensibility project (or elements within it) in the Eclipse Package Explorer tab.
Note: The Deploy Toolkit Support command is not available if you installed the UFT One Java Add-in Extensibility SDK before installing UFT One and the Java Add-in. To solve this problem, uninstall the UFT One Java Add-in Extensibility SDK and install it again. For more information, see Installing the OpenText UFT One Java Add-in Extensibility Software Development Kit.
You use the Deploy Toolkit Support command to deploy the toolkit support during the development stages. To use this command, UFT One and the UFT One Java Add-in Extensibility Eclipse Plug-in must be installed on the same computer.
This command copies the toolkit configuration file and the test object configuration file to the appropriate UFT One folders. In the toolkit configuration file, the location specified for the compiled support classes is the Eclipse workspace. The next time you run the Java application, the support you developed is available on UFT One. For more information, see Deploying and Running the Custom Toolkit Support.
Note: The deploy command compiles the Java classes before deploying, but does not validate compilation results. Save the support classes before deploying and check for compilation errors, to avoid run-time failure.
The Deploy Toolkit Support command copies only the test object configuration file that is named <Custom Toolkit Name>TestObjects.xml. If you create additional test object configuration files you must copy them to the appropriate folders, specified in Deploying and Running the Custom Toolkit Support.
The Deploy Toolkit Support command validates the configuration files against their corresponding XSD files, and only deploys them if their format meets the requirements (or you specify that you want to deploy in spite of the displayed discrepancies). For information on the structure of the configuration files, see the
The toolkit configuration file is validated against:
<UFT_One_installdir>\bin\java\sdk\eclipse\plugins\com.mercury.qtjext.plugin.QTJavaExt_1.0.0\ToolkitSchema.xsd
The test object configuration file is validated against:
<UFT_One_installdir>\bin\java\sdk\eclipse\plugins\com.mercury.qtjext.plugin.QTJavaExt_1.0.0\ClassesDefintions.xsd
The Reload Support Configuration command is available in Eclipse when you select a UFT One Java Add-in Extensibility project (or elements within it) in the Eclipse Package Explorer tab.
Note: The Reload Support Configuration command is not available if you installed the UFT One Java Add-in Extensibility SDK before installing UFT One and the Java Add-in. To solve this problem, uninstall the UFT One Java Add-in Extensibility SDK and install it again. For more information, see Installing the OpenText UFT One Java Add-in Extensibility Software Development Kit.
The Reload Support Configuration command instructs the UFT One Java Add-in Extensibility Eclipse plug-in to update the plug-in's list of supported Java classes and test object classes by reloading:
the selected project's configuration files and support classes
all of the toolkit configuration files and test object configuration files from the UFT One installation folder
The Reload Support Configuration command affects the following items in the New UFT One Custom Support Class wizard:
The list of custom classes displayed in the custom toolkit tree in the Custom Class Selection Screen.
The wizard's selection of the base support class in the Custom Class Selection Screen.
The list of existing test object classes displayed in the Test Object Class Selection Screen.
The following examples demonstrate situations that require reloading the support configuration:
You modified the test object configuration file in the UFT One Java Add-in Extensibility project, adding or removing test object classes. You now want the wizard's list of existing test object methods to reflect these changes.
You manually deployed support of a custom toolkit to UFT One, and you want the wizard to recognize that the classes are supported.
You manually deleted support for some classes from UFT One, and you want these classes to be removed from the list of supported classes in the Eclipse plug-in.
You created a custom toolkit support set (named Support Set A) in one Eclipse project and deployed it. You are now creating a custom toolkit support set (named Support Set B) for another custom toolkit in a different Eclipse project. You want to use a support class from Support Set A as the base support class for a support class in Support Set B.
The Delete Custom Support command is available in Eclipse when you select a UFT One Java Add-in Extensibility custom support class in the Eclipse Package Explorer tab.
Note: The command is available only if this class was created as a UFT One Java Add-in Extensibility custom support class in this Eclipse workspace.
You use this command to delete support for a specific custom class. The support class is deleted, as well as its listing in the toolkit configuration file. If you created a new test object class for this support class, it is not deleted from the test object configuration file because other support classes can use it.
If you delete the support class using the Eclipse Delete command, instead of the Delete Custom Support, you must manually remove the mapping of the custom control to this support class in the toolkit configuration file.
Tip: If you want to delete a support class you have just created, make sure you save the support class first.
After deleting a support class, if you previously deployed support for this custom class to UFT One, you must re-deploy the toolkit support. This replaces the toolkit configuration file with the updated one, removing the support for this custom class from UFT One as well.
If you delete a support class that serves as the base support class for another, you must manually change the inheritance of this other class. For example: InheritedCS extends ToDeleteCS that extends BuiltInCS. If you delete ToDeleteCS, you must manually change InheritedCS to extend BuiltInCS.
You cannot remove support of a complete toolkit using the UFT One Java Add-in Extensibility Eclipse Plug-in commands. To do this you have to manually delete the toolkit configuration files from their locations in the UFT One folders. For more information, see Deploying and Running the Custom Toolkit Support.
The Add Identification Property command is available in Eclipse when you select a UFT One Java Add-in Extensibility custom support class in the Eclipse Package Explorer tab.
Note: This command is available only if this class was created as a UFT One Java Add-in Extensibility custom support class in this Eclipse workspace.
You use this command to add an identification property after the support class is created.
You must deploy the toolkit support for the changes to take effect on UFT One.
If you add an identification property to the test object class definition, it appears in the list of identification properties in UFT One for all test objects of this class. It is for this reason that, if you plan to add properties, you create a new test object class based on the existing one, instead of modifying an existing test object class.
To add an identification property:
Click the Add Identification Property button in the UFT One toolbar in Eclipse. The Identification Property dialog box opens.
Enter a name for the new identification property and click OK.
A confirmation box opens notifying you that in addition to adding the new identification property to the support class, the property will also be added to the definition of the test object class mapped to the supported control. This identification property will then appear in the list of identification properties in UFT One for all test objects of this class.
Click Yes if you want to continue. (If you click No, the new identification property is discarded.)
A support method stub for the identification property you defined, named <identification property name>_attr, is added to the support class. The method stub returns null until you implement the method to match the needs of your custom control.
Another message box prompts you to select whether you want the new identification property to be selected by default in checkpoints.
After you make your selection, the new identification property is added to the test object class definition in the test object configuration file.
If you clicked Yes, the ForDefaultVerification attribute is added to the identification property definition and set to true. Otherwise, the ForDefaultVerification is not added. (In both cases, the ForVerification attribute is added and set to true, so that the new identification property is always available for checkpoints.)
If you add an identification property that you want to be part of the unique test object description, you have to manually define this in the test object configuration file. In the row for this identification property, between the words Property and Name add the words ForDescription="true". This adds the ForDescription attribute to the Property element and sets it to true.
For more information, see the UFT One Test Object Schema Help.
The Add Test Object Method command is available in Eclipse when you select a UFT One Java Add-in Extensibility custom support class in the Eclipse Package Explorer tab.
Note: This command is available only if this class was created as a UFT One Java Add-in Extensibility custom support class in this Eclipse workspace.
You use this command to add a test object method after the support class is created.
You must deploy the toolkit support for the changes to take effect on UFT One.
If you add a test object method to an existing test object class, the new methods appear in UFT One for all test objects of this class, regardless of whether or not they are supported for these objects. In a UFT One GUI test, if you call a test object method for an object, and that method is not supported, a run-time error occurs.
Therefore, if you plan to add test object methods to support a custom control, it is recommended to create a new test object class based on the existing one, instead of modifying an existing test object class.
Click the Add Test Object Method button in the UFT One toolbar in Eclipse. The Test Object Method Dialog box opens.
Define the details of the test object method you want to add, and click OK. For more information, see Understanding the Test Object Method Dialog Box.
A confirmation box opens notifying you that in addition to adding new test object method to the support class, the test object method will also be added to the definition of the test object class mapped to the supported control. The test object method will then appear in UFT One for all test objects of this class.
Click Yes if you want to continue. (If you click No, the new test object method is discarded.)
A support method stub for the test object method you defined, named <test object method name>_replayMethod, is added to the support class. This method stub returns the error value Retval.NOT_IMPLEMENTED until you implement it to match the needs of your custom control.
In addition, the test object method is added to the test object class definition in the test object configuration file. For information on the structure and content of this file, see the UFT One Test Object Schema Help.
The Add Event Handler command is available in Eclipse when you select an AWT-based UFT One Java Add-in Extensibility custom support class in the Eclipse Package Explorer tab.
Note: This command is available only if this class was created as a UFT One Java Add-in Extensibility custom support class in this Eclipse workspace.
You use this command to add an event handler to the support class after it is created.
The following options are available in the Custom Control Recording Support wizard screen when you create a new support class:
Treat controls of this class as wrapper controls
Override low-level mouse event recording
Override low-level keyboard event recording
If you did not select them when you created the support class, and you want to implement them, you have to do so manually. For information on how to do this, see Supporting the Record Option.
Click the Add Event Handler button in the UFT One toolbar in Eclipse. The Listener dialog box opens:
Select a listener from the list.
If the selected listener has more than one registration method, select a method from the Registration method list.
Click OK.
The listener you selected is added to the signature of the support class.
A constructor is added to the support class (or modified, if it already exists) to call the addSimpleListener method for the listener you selected. This adds the listener to the list of listeners that need to be registered on the custom control, and specifies the methods used to register and remove it.
Method stubs for all of the event handler methods that comprise the listener you selected are added to the support class. A comment is added to each method stub, reminding you to implement the event handler to call MicAPI.record to send a record message to UFT One. For more information, see Supporting the Record Option.