Step-by-Step Instructions for Supporting Custom Delphi Controls

This section guides you through the process of creating a UFT One Delphi Add-in Extensibility toolkit support set.

Determine the extent of customization required

In some cases, it is sufficient to map your custom control to an existing Delphi test object class. In this case, create and deploy the toolkit configuration file as described in the procedure below, but compile the application you are testing with the MicDelphiAgent.pas module, as described in the Delphi Add-in section of the UFT One Help Center.

In other cases, mapping the custom control to an existing test object class does not provide adequate support, even though the test object class includes all of the necessary test object methods and identification properties. In these cases, you do not need to create a new test object class to support the custom control, but you do need to create a Delphi extensibility unit that supports the test object methods and properties.

Back to top

Create your toolkit configuration file

  1. Decide which test object classes will represent your custom controls in UFT One tests and components. You can map your custom controls to existing Delphi test objects classes, or to custom test object classes that you define later in this task.

  2. Decide which custom test object classes you will create to represent your custom controls (if any), and which existing Standard Windows test object classes will serve as their inner objects.

  3. Copy the sample toolkit configuration file, <UFT One installation folder>\samples\DelphiExtSample\ToolkitSupportSet\TrackerSampleToolkitCfg.xml, to create your toolkit configuration file. For information on the structure and syntax of this XML, see Understanding the Toolkit Configuration XML File Structure.

  4. For each custom control that you want to support, make a copy of the Value element that maps the TTrackBar custom control to the custom test object class DelphiTrackBar. Replace TTrackBar and DelphiTrackBar with the appropriate names.

  5. For each custom test object class that you create (if any), make a copy of the Key element that contains the settings for the DelphiTrackBar custom test object class. Replace the test object name, the InnerProgId, and the InnerMicClass values, with the appropriate test object names.

    You must select an inner object that matches the functionality of the control you are supporting. In most cases, the inner object should be a generic test object class like WinObject. You can use a more specific test object class when you are sure that it is appropriate for the type of control you are supporting (for example, you can use the WinListView test object as an inner object when creating support a control that subclasses TListView).

    In order to verify that the test object class you are using for an inner object is appropriate, use the UFT One Object Mapping dialog box to map this test object class to your control and ensure that you can successfully use the Object Spy on your control.

    For more information on the Object Mapping dialog box, see the UFT One User Guide.

Back to top

Deploy your toolkit configuration file

Copy the toolkit configuration XML file to the <UFT One installation folder>\dat\Settings folder.

Back to top

Create your test object configuration file

If all of your custom controls are mapped to existing Delphi test object classes, skip to verifying the test object class mapping.

Otherwise, create a test object configuration XML file in which you define your custom test object classes. Define description properties, identification properties, and test object methods for each custom test object class. For more information, see Designing Your Test Object Configuration XML File.

Back to top

Deploy your test object configuration file

If you created a test object configuration XML file, copy it to the <UFT One installation folder>\dat\Extensibility\Delphi folder.

Back to top

Verify the test object class mapping

Open UFT One, open a GUI test, and make sure that:

  • When you use the Object Spy, UFT One recognizes your custom controls correctly.

  • When UFT One learns your custom controls, the corresponding test objects are added to the Object Repository.

    Note: If mapping your custom control to an existing Delphi test object provides sufficient support for creating and running tests and components on this control, you do not need to perform any of the remaining steps in this procedure.

Back to top

Create a basic extensibility Delphi unit

Create your extensibility code using the Agent Object Implementation Template <UFT One installation folder>\dat\Extensibility\Delphi\ExtensibilityImplementationTemplate.pas.

Define some visible published properties in the Agent Object.

Back to top

Compile your extensibility code

Compile the application you are testing with the UFT One Delphi Add-in precompiled agent and with your extensibility unit. To do this, perform the procedure described in Compiling Your Extensibility Code.

Back to top

Verify the functionality of your extensibility code

Run your Delphi application and verify that your Agent Object is functioning correctly by testing that you can use the UFT One Object Spy to view the properties that you defined when you created a basic extensibility Delphi unit.

Back to top

Complete the development of your extensibility Delphi unit

Implement the rest of the Agent Object's published properties to support the identification properties and test object methods that you defined in the test object configuration file.

Back to top