Open topic with navigation
In this section, you complete the definition of your test object class by specifying the operations (methods) and identification properties you want to be available for WebExtBook test objects. These definitions are stored in the test object configuration file (
Select the Operations tab on the left side of the WebExtBook test object class designer.
In the Operations toolbar, click Add .
A new operation, named Operation1 is added to the list of operations, and selected.
In the Name box, enter
In the Description box, enter
Opens the UsedBooks page.
Repeat the steps above to add an operation named
Select, with the description
Selects the book.
Select the Default operation check box (for the Select operation).
View the remaining options in this tab to learn what is available. For details, see Operations Tab (Test Object Class Designer).
The Select and GoToUsedBooksPage operations do not receive any arguments or return a value. Therefore, you do not need to make any additional changes.
Add a new operation, named
GoToAuthorPage, with the description
Opens the Web page for the specified author.
In the Operation Arguments toolbar, click Add .
In the Name column in the Operation Arguments table, enter
Clear the check box in the Optional column, because this is a mandatory argument.
In the Description column, enter
Accept the default values in the Direction and Type columns. These indicate that this is a string value passed to the operation.
Click the Class View tab beneath the Project Explorer to open the Class View:
The WebExtBook test object class and the icon you specified for it are displayed in the list of test object classes. The operations that you defined are displayed in the list of operations.
Select the html tag property and click Inherit From Base Class in the Properties toolbar.
Do the same thing for the html id property.
In the Properties toolbar, click Add .
A new property, named Property1, is added to the list of properties and selected.
Click on the property name and enter
Add additional properties named
The lists of properties on the right side of this tab specify the functionalities for which UFT uses the properties.
Select the Object Identification - Mandatory group.
Adding properties to this group instructs UFT to use these properties for the test object description. (The test object description is a set of properties used to uniquely identify a specific test object.)
html tag and html id were added to this group automatically.
Double-click on the properties
authors to add them to the group.
Select the Checkpoints and Output Values group.
Adding properties to this group makes the properties available for checkpoints and output values in UFT.
Double-click each of the properties that you created to add them to this group.
The check box for each of the properties you add is selected by default. This instructs UFT to select the properties by default when creating checkpoints and output values.
Select the Object Spy group.
Adding properties to this group makes the properties available in the UFT Object Spy. All of the properties were added to this group by default.
Open the Project Viewer and double-click the
WebExtSampleTestObjects.xml file. In the file, you can see that the operations and identification properties of the WebExtBook test object class are now defined according to the details described in the Web Add-in Extensibility Planning Checklist.
The operations are defined, with their descriptions, and, where relevant, their arguments. The Select operation is specified as the default operation for the test object class. The properties are defined, with XML attributes indicating the groups to which they belong:
<ClassInfo DefaultOperationName="Select" GenericTypeID="Object" Name="WebExtBook" BaseClassInfoName="WebElement"> <Description>The test object class used to represent a Book control. </Description> <HelpInfo />
<IconInfo IconFile="INSTALLDIR\Dat\Extensibility\Web\Toolkits\WebExtSample\Res\WebBook.ico" IconIndex="0" /><TypeInfo> <Operation Name="GoToAuthorPage" PropertyType="Method"> <Description>Opens the Web page for the specified author.</Description> <Argument Name="AuthorName" IsMandatory="true"> <Type VariantType="String" /> <AdditionalInfo xsi:type="xsd:string">The author.</AdditionalInfo> </Argument> </Operation> <Operation Name="GoToUsedBooksPage" PropertyType="Method"> <Description>Opens the UsedBooks page.</Description> </Operation> <Operation Name="Select" PropertyType="Method"> <Description>Selects the book.</Description> </Operation> </TypeInfo> <IdentificationProperties> <IdentificationProperty Name="authors" ForVerification="true" ForDefaultVerification="true" /> <IdentificationProperty Name="min_used_price" ForVerification="true" ForDefaultVerification="true" /> <IdentificationProperty Name="price" ForVerification="true" ForDefaultVerification="true" /> <IdentificationProperty Name="title" ForVerification="true" ForDefaultVerification="true" /> </IdentificationProperties> </ClassInfo>
For details on the structure and content of the test object configuration file, see the