Mapping Test Object Classes to Inner Objects

This topic gives information about mapping test object classes to inner objects with examples.

Within the MicTest root element of the toolkit configuration XML file, under the Key element where Name="Test Objects", you define one Key element for each custom Delphi test object class that you want to map.

The Name attribute of this Key element must contain the name of the custom Delphi test object class. For example, the excerpt below is part of the test object configuration file that maps the DelphiTrackBar test object class to the WinObject test object class that serves as its inner object:

<?xml version="1.0"?>
<MicTest>
...
  <Key Name="Test Objects">
    <!-- mapping for DelphiTrackBar -->
    <Key Name="DelphiTrackBar">
...
    </Key>
  </Key>
</MicTest> 

Within the Key element for each custom Delphi test object class define the following Value elements:

Name Attribute

Type Attribute

Element Use

Element Value

BottomLevelObject

I4

Optional

Specifies whether test objects of this type can contain other objects.

Possible values:

  • 0: Test object is not a bottom-level object. It can contain child objects. (Default)

  • 1: Test object is a bottom-level object. It cannot contain child objects.

CLSID

BSTR

Required

Required value: {A990252E-48C1-4d6c-9B55-4701BC29919C}

(Default)

BSTR

Required

The name of the custom Delphi test object class that you want to map.

ExtObjRecFilter

I4

Optional

Specifies which Windows messages OpenText Functional Testing passes to the Agent Object for recording.

Possible values:

  • 0: Only messages addressed to the control's window are passed to the Agent Object for recording. (All other messages are ignored.)

  • 1: All Windows messages are passed to the Agent Object for recording.

  • 2: Only messages addressed to the control or its children are passed to the Agent Object for recording. (All other messages are ignored.)

If this element is not defined, all recording is handled by the inner object.

InnerMicClass

BSTR

Required

The name of the existing Standard Windows test object class that you want to use as the inner object.

For a list of available test object classes, see the Standard Windows section of the Object Model Reference.

InnerProgId

BSTR

Required

Mercury.<InnerMicClass>

Exceptions: For the following InnerMicClass values, set InnerProgId as specified below:

Window: Mercury.StdWindow

Dialog: Mercury.WinDialog

Static: Mercury.WinStatic

Desktop— Mercury.MicDesktop

tag query name

BSTR

Required

Required value: delphi_name

Additional Definitions Within the Test Objects Key Element

This section describes additional optional elements that you can define within the Key element defined for each custom Delphi test object class:

  • In some dialog boxes, OpenText Functional Testing displays a list of available test object classes per environment (for example, the Define New Test Object dialog box, the Object Identification dialog box, and the Step Generator dialog box). If you want to display your custom Delphi test object classes in these dialog boxes, you must add the following lines in the Key element for each custom Delphi test object class:

    <Key Name="Info">
      <Value Name="package" Type="BSTR">DelphiPackage</Value>
    </Key>
  • If you want your custom Delphi test object class to be treated as a grid (table), you must add additional elements within the Key element that you define for this test object class. For more information, see Design Treating Your Custom Grid Control as a Table.

  • The Checkpoint Properties dialog box in OpenText Functional Testing includes a Checkpoint timeout value (in seconds). You can customize the default checkpoint timeout value that is used when creating new checkpoints on your custom test object class. (Otherwise the default is 0). To set the default checkpoint timeout value, add an additional Key element, like the one below, within the Key element defined for your custom Delphi test object class. Replace the number 10 in these lines with the default you want to use:

    <Key Name="CheckpointTimeout">
      <Value Name="DefaultTimeout" Type="I4">10<!--0xA--></Value>
    </Key>

Back to top

View an Example for the Test Objects Key Element

The example below shows the entire Key element defined to map the DelphiTrackBar test object class to the existing WinObject test object class:

<?xml version="1.0"?>
<MicTest>
...
  <Key Name="Test Objects">
    <!-- The mapping definitions for the DelphiTrackBar test object -->
    <Key Name="DelphiTrackBar">
       <!- The name of the custom Delphi test object class being mapped.-->
       <Value Name="(Default)" Type="BSTR">DelphiTrackBar</Value>
       <!- The name (and ProgId) of the Standard Windows inner object.-->
       <Value Name="InnerProgId" Type="BSTR">Mercury.WinObject</Value>
       <Value Name="InnerMicClass" Type="BSTR">WinObject</Value>
       <!- ExtObjRecFilter Value element is set to 0: only messages addressed to the 
             control's window are passed to the Agent Object for recording. 
             All other messages are ignored. -->
       <Value Name="ExtObjRecFilter" Type="I4">0</Value>
       <!- BottomLevelObject Value element is set to 1: Test objects of this class 
             do not have child objects. -->
       <Value Name="BottomLevelObject" Type="I4">1</Value>
       <!- These elements are defined identically for every mapped test object class.-->
       <Value Name="tag query name" Type="BSTR">delphi_name</Value>
       <Value Name="CLSID" Type="BSTR>
                   {A990252E-48C1-4d6c-9B55-4701BC29919C}
       </Value>
       <Key Name="Info">
         <Value Name="package" Type="BSTR">DelphiPackage</Value>
       </Key>
    </Key>
  </Key>
</MicTest> 

Back to top