Deploy the support to UFT One and test it again

You have now completed the design required to support running steps on the Book control, performing operations, and retrieving property values.

In this section, you deploy the toolkit support set to UFT One again, and test running steps on the Book control. Before deploying, you make the changes that are necessary to support the Documentation column in the Keyword View.

Add Documentation elements

Manually add Documentation elements to the test object configuration file.

Open the WebExtSampleTestObjects.xml file from the Project Explorer in Extensibility Accelerator and add Documentation elements to the operations you defined. The TypeInfo element should now look like this:

    <TypeInfo>
        <Operation Name="GoToAuthorPage" PropertyType="Method">
            <Description>Opens the Web page for the specified author.</Description>
            <Documentation><![CDATA[Open the Web page for %a1.]]> </Documentation>
            <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>
            <Documentation><![CDATA[Open the %l UsedBooks page.]]></Documentation>
        </Operation>
        <Operation Name="Select" PropertyType="Method">
            <Description>Selects the book.</Description>
            <Documentation><![CDATA[Select the %l book.]]></Documentation>
        </Operation>
    </TypeInfo>

Back to top

Deploy your support to UFT One

Select Project > Deploy > Deploy to UFT.

Back to top

Open UFT One and run the Book application

  1. Close and reopen UFT One. Select the check box for WebExtSample in the Add-in Manager dialog box and click OK. UFT One opens and loads the support you designed.

  2. Close and rerun the sample control.

Back to top

Test the support for naming the test object

Open a GUI test, open the Object Repository, and use the Add Object to Local button to learn the Book control. Make sure that the test object that UFT One creates is named The History of QuickTest Professional.

Back to top

Test the support for running test object operations

  1. Create a test with the following step and then run the test:

    Browser("Book").Page("Book").WebExtBook("The History of QuickTest Professional"). 
    GoToAuthorPage "Jane Doe"
    

    Note: If you run the GoToAuthorPage test object method with an author name that does not exist in the control, the JavaScript function throws an exception. If your browser displays an error message about the unhandled exception, asking if you want to debug, click No.

    UFT One displays a run-time error message with the string provided by the exception, and the test step fails.

  2. Create and run similar tests to test the Select and GoToUsedBooksPage test object methods.

  3. Verify that the documentation strings displayed for the test object operations in the Keyword view are correct.

Back to top

Test the support for retrieving run-time values of identification properties

  1. Create a step with a WebExtBook test object.

  2. Right-click the object and select Insert Standard Checkpoint. The Checkpoint Properties dialog box opens. Make sure that the identification properties you defined in the test object configuration file (title, authors, price, and min_used_price) are included in the list of properties and are selected.

  3. Create and run a test that retrieves each identification property and checks its value, or displays it in a message box. For example, you can run the following test:

    The first step checks the value of the authors property, the checkpoint in the second step checks the properties selected in the checkpoint (in this case price and min_used_price) and the third step displays the book's title in a message box.

  4. Click OK to close the message box. The test run is completed and the run results are displayed. Expand the run results tree to view the step details.

Back to top