Tutorial: Create UFT Support for a Custom WPF Control > Designing the Test Object Configuration File

Designing the Test Object Configuration File

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

  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 opens, you do not select the MyWpfToolkit environment, UFT 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" 
                   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:

For more information on the elements and attributes in the test object configuration file, see the Unified Functional Testing Test Object Schema Help

Continue to Deploying and Testing the Preliminary Toolkit Support Set.