Delphi Add-in Extensibility Samples

The Delphi Add-in Extensibility SDK includes samples to help you learn about Delphi Add-in Extensibility. You can also use the samples as a basis for your extensibility files.

Available samples

The Delphi Add-in Extensibility SDK includes the following samples:

  • The basic Delphi Add-in extensibility sample provides a toolkit support set for the TTrackBar control, which is not supported out-of-the-box by the Delphi Add-in. This toolkit support set provides a comprehensive example of how to extend UFT One support for a custom control.

  • The Delphi Add-in grid extensibility sample provides a toolkit support set for the TStringDrawGrid control, which is a custom grid control that inherits from the TCustomGrid class. This toolkit support set demonstrates only how to teach UFT One to treat a custom grid control as a table. For more information, see Creating Support for Custom Grid Controls.

The samples are located under <UFT One installation folder>\samples, in the DelphiExtSample and DelphiGridExtSample folders. Within each of these folders, the custom control and its source files are located in the Application sub-folder, and the toolkit support set files (configuration files and extensibility unit) are located in the ToolkitSupportSet sub-folder.

Back to top

How to use the samples

You can use these samples in the following ways:

  • Study the content of the toolkit support set files to gain a better understanding of how to develop your own toolkit support sets.

  • Copy the toolkit support set files (or parts of them) and use them as a basis for designing your toolkit support sets.

  • Learn how extensibility can affect UFT One's interaction with custom controls. To do this, create and run a UFT One test on the sample custom control before and after deploying the sample toolkit support set to UFT One. The procedure described below guides you through this process for the TTrackBar sample. You can perform a similar procedure using the TStringDrawGrid sample.

Back to top

Analyze the TTrackBar extensibility sample

To analyze how the TTrackBar extensibility sample affects UFT One's interaction with the TTrackBar custom control:

  1. Use the UFT One Object Spy to see how UFT One recognizes the TTrackBar control. Create and run a simple test on the control.

    You can see that UFT One uses a generic DelphiObject test object to represent the track bar control. To set the location of the thumb on the track bar, you must use Click, Drag, and Drop operations.

  2. Deploy the toolkit support set for the TTrackBar control according to the instructions in Deploying the Toolkit Support Set.

  3. Use the UFT One Object Spy to see how UFT One recognizes the TTrackBar control now that the extensibility support is enabled. Create and run a simple test on the control.

    You can see that with extensibility support enabled, UFT One uses a DelphiTrackBar test object (and a customized icon) to represent the control. The DelphiTrackBar test object supports the Set, Next, and Prev operations for modifying the location of the thumb on the track bar. In addition, when you drag the track bar thumb during a recording session, UFT One records test steps with the Set operation.

Back to top

Open the extensibility sample project in Delphi Studio

The Delphi Add-in grid extensibility sample project, DelphiGridExtSample, references the TStringDrawGrid custom control. Therefore, to successfully open DelphiGridExtSample in Delphi Studio, you must first register TStringDrawGrid in Delphi Studio.

To open the Delphi Add-in grid extensibility sample project in Delphi Studio:

  1. In Delphi Studio, select Component > Install Component. The Install Component dialog box opens.

  2. In the Unit file name box, specify the full path for the StringDrawGrid.pas file. The file is located in: <UFT One installation folder>\samples\DelphiGridExtSample\Application.

  3. Click OK. If confirmation or information dialog boxes open, click Yes and/or OK, as necessary.

    The Package dialog box opens.

    Note: If Delphi Studio displays the StringDrawGrid.pas file for editing at this point instead of opening the Package dialog box, repeat these steps to start again.

  4. Click Compile.

  5. Close the Package dialog box, and click Yes in the save confirmation box that opens.

  6. Open DelphiGridExtSample.

Back to top