Designing the Test Object Configuration File

Supported on versions 2021 R1 and earlier

You use the test object configuration file to introduce the MyWpfToolkit environment and its test object class to UFT One.

  1. Open the MyWpfToolkitTestObjects.xml file.

    The MyWpfToolkitTestObjects.xml file was created with the AddinName attribute in the TypeInformation element set to WPF and the PackageName attribute set to MyWpfToolkit. This associates the test object configuration file (and the test objects defined in it) with the MyWpfToolkit environment under the WPF Add-in. If, when UFT One opens, you do not select the MyWpfToolkit environment, UFT One ignores the test object class definitions in this file.

    Note: When developing support for a Silverlight control, the TypeInformation element is set to Silverlight.

    Based on the information you provided in the WPF Custom Server Setup dialog box, the ClassInfo element for the MyWpfCalendar test object class was also created, specifying WpfObject as its base class. This means that the new MyWpfCalendar test object class you define inherits the WpfObject methods, generic type, Help file, etc.

  2. To extend the test object class and add definitions for the calendar-specific operations and identification properties, replace the comment lines within MyWpfToolkitTestObjects.xml so that your test object configuration file contains the following:

  3. <TypeInformation AddinName="WPF" PackageName="MyWpfToolkit“ >
        <ClassInfo Name="MyWpfCalendar" 
                   BaseClassInfoName="WpfObject" 

                   DefaultOperationName="SetDate“>         <IdentificationProperties>             <IdentificationProperty Name="devname"                                     ForDescription="true" />             <IdentificationProperty Name="devnamepath"                                     ForAssistive="true"                                     AssistivePropertyValue="1"/>             <IdentificationProperty Name="regexpwndtitle"                                     ForAssistive="true"                                     AssistivePropertyValue="2"/>             <IdentificationProperty Name="x"                                     ForVerification="true" />             <IdentificationProperty Name="y"                                     ForVerification="true" />             <IdentificationProperty Name="is_today_highlighted"                                     ForVerification="true"/>         </IdentificationProperties>         <TypeInfo>             <Operation Name="Next" PropertyType="Method"/>             <Operation Name="Prev" PropertyType="Method"/>             <Operation Name="SelectedDate"                              PropertyType="Property_Get“ >                 <ReturnValueType>                     <Type VariantType="VT_BSTR"/>                 </ReturnValueType>             </Operation>             <Operation Name="SetDate" PropertyType="Method“ >                 <Argument Name="Date"                           IsMandatory="true"                           Direction="In“>                     <Type VariantType="VT_BSTR"/>                 </Argument>             </Operation>         </TypeInfo>     </ClassInfo> </TypeInformation>

    You have now defined:

    • The Previous, Next, and SetDate test object methods and the SelectedDate property, including all relevant parameters, return values, and their types. SetDate is the default operation for this test object class.

    • The devname, devnamepath, regexpwndtitle, x, y, and is_today_highlighted identification properties.

      • The first 5 properties are supported by the base class, and the implementation for retrieving their values is inherited. However, identification property definitions are not automatically inherited, which is why you must define them here.

      • For each identification property, you specified whether it should be included in the test object description, used as an assistive property, or available for verification in checkpoints.

For more information on the elements and attributes in the test object configuration file, see the UFT One Test Object Schema Help

Continue to Deploying and Testing the Preliminary Toolkit Support Set.