Mapping Application Controls to Test Object Classes
Within the MicTest root element of the toolkit configuration XML file, under the Key element where Name="Packages"
, create a structure similar to the following:
<?xml version="1.0"?> <MicTest> <Key Name="Packages"> <Key Name="DelphiPackage"> <Key Name="ClassPatterns"> <!-- One Value element for each custom control that you --> <!-- want to map. This example shows the mapping for the --> <!-- TStringDrawGrid custom control. --> <Value Name="TStringDrawGrid" Type="BSTR">DelphiCustomTable</Value> </Key> <Key Name="CustomServers"> <!-- One Key element for each custom grid control that you want --> <!-- to support. This example shows the definition for the --> <!-- TStringDrawGrid custom control. --> <Key Name="TStringDrawGrid"> <Value Name="CustReplayProgID" Type="BSTR"> Mercury.DelphiTableSrv </Value> </Key> </Key> </Key> </Key> ... </MicTest>
Within the Key element whose Name attribute is DelphiPackage, create a ClassPatterns
Key element and, optionally, a CustomServers
Key element.
The ClassPatterns Key Element
Within the Key element whose Name attribute is ClassPatterns
, define one Value element for each type of custom control that you want to support.
In each Value element:
The Name attribute contains the window class name of your custom control.
The Type attribute is set to
BSTR
.The element value contains the name of the custom Delphi test object class that UFT One should use to represent the control in tests and components.
The CustomServers Key Element
If you are creating support for custom grid controls, create a Key element whose Name attribute is CustomServers
. Within this Key attribute, define one Key element for each custom grid control that you want to support.
The Key element for each custom grid control contains:
A Name attribute that contains the window class name of your custom control.
The following Value element:
<Value Name="CustReplayProgID" Type="BSTR"> Mercury.DelphiTableSrv </Value>
Alternatively, you could create a single Key element (within the CustomServers Key element) to instruct UFT One to use the grid test object extension for all custom controls mapped to a certain custom test object class. To do this, set the Name attribute of the Key element to
MC2CSMapping_<custom grid test object class name>
.
For more information on supporting custom grid controls, see Creating Support for Custom Grid Controls.