The first stage of developing support for a custom toolkit is to introduce the test object model that you want UFT One to use to test your applications and controls. To do this, you define the test object model in the test object configuration XML file. You need to create a test object class for every type of custom control for which you want to extend or modify UFT One support.
In a test object configuration XML, you define the test object classes (for example, the test object methods they support, their identification properties, and so on).
If the relevant add-in is not loaded when UFT One opens, UFT One does not load the information in this XML. Similarly, if the name of the environment or custom toolkit is displayed in the Add-in Manager dialog box and its check box is not selected, the information in this XML is not loaded.
For more information, see How UFT One Loads the Test Object Configuration XML.
The sections below describe the information that you can include in a test object class definition.
The name of the
The test object class name must be unique among all of the environments whose support a UFT One user might load simultaneously. For example, when defining a new test object class, do not use names of test object classes from existing UFT One add-ins, such as
A test object class inherits the base class' test object operations (methods and properties), generic type, default operation, and icon. Identification properties are
If you create test object classes that extend test object classes defined in another toolkit support set, you create a dependency between the two toolkit support sets. Whenever you select to load the extending toolkit support set in the UFT One Add-in Manager, you must also select to load the toolkit support set that it extends.
The generic type for the
Generic types are used when filtering objects (for example, in the Step Generator's Select Object for Step dialog box and when adding multiple test objects to the object repository). Generic types are also used when creating documentation strings for the Documentation column of the Keyword View (if they are not specifically defined in the test object configuration file).
A list of operations for the test object class, including the following information for each operation:
The arguments, including the argument type (for example,
Integer), direction (
Out), whether the argument is mandatory, and, if not, its default value.
Whether a dynamic list of possible values for this argument can be retrieved from the supported control and displayed in the Keyword View, Editor, and Step Generator.
The operation description (shown in the Object Spy and as a tooltip in the Keyword View and Step Generator).
The Documentation string (shown in the Documentation column of the Keyword View and in the Step Generator).
The return value type.
A context-sensitive Help topic to open when F1 is pressed for the test object operation in the Keyword View or Editor, or when the Operation Help button is clicked for the operation in the Step Generator. The definition includes the Help file path and the relevant Help ID within the file.
The test object operation that is selected by default in the Keyword View and Step Generator when a step is generated for an object of this class.
A list of identification properties for the test object class. You can also define:
The identification properties that are used for the object description.
Tip: Include the html tag property in the object description to facilitate faster object identification in UFT One.
The identification properties that are used for smart identification. (This information is relevant only if smart identification is enabled for the test object class. To enable smart identification, use the Object Identification dialog box in UFT One.)
The identification properties that are available for use in checkpoints and output values.
The identification properties that are selected by default for checkpoints (in the UFT One Checkpoint Properties dialog box).
When defining identification properties, it is recommended to start by copying existing identification properties from the base object in your schema or from similar objects in related toolkits.
The path of the icon file to use for this test object class. (Optional. If not defined, the base class' icon is used.) The file can be a .dll, .exe, or .ico file.
A context-sensitive Help topic to open when F1 is pressed for the test object in the Keyword View or Editor. The definition includes the .chm Help file path and the relevant Help ID within the file.
For information on the structure and syntax of a test object configuration XML, see UFT One Test Object Schema Help.
The following example shows the definition of the WebExtUsedBooks test object definition, which is part of the WebExtSample toolkit used for the tutorial section of this guide:
<ClassInfo BaseClassInfoName="WebTable" GenericTypeID="Table" DefaultOperationName="SelectBook" Name="WebExtUsedBooks"> <IconInfo IconFile="INSTALLDIR\Dat\Extensibility\Web\Toolkits\WebExtSample\Res\WebBookList.ico"/> <TypeInfo> <Operation ExposureLevel="CommonUsed" Name="SelectBook" PropertyType="Method"> <Description> Selects the radio button for the specified book and clicks Select. </Description> <Documentation> <![CDATA[Select the radio button for the book with index %a1 and click Select.]]> </Documentation> <Argument Name="BookIndex" IsMandatory="true" Direction="In"> <Type VariantType="Integer"/> </Argument> </Operation> </TypeInfo> <IdentificationProperties> <IdentificationProperty ForDefaultVerification="true" ForVerification="true" ForDescription="true" Name="title"/> </IdentificationProperties> </ClassInfo>
This example shows that the WebExtUsedBooks test object class extends the WebTable test object class. The WebExtUsedBooks test object class uses the WebBookList.ico icon file, its default test object method is SelectBook (which has one Integer mandatory input parameter: BookIndex), and it has one additional identification property: title.
One identification property is defined for the WebExtUsedBooks test object class: title. This identification property is used in the object description, available for checkpoints and output values, and selected by default in the Checkpoint Properties dialog box in UFT One.