Open topic with navigation
The Delphi Add-in Extensibility SDK includes the following samples to help you learn about Delphi Add-in Extensibility. You can also use the samples as a basis for your extensibility files.
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 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 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 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.
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's interaction with custom controls. To do this, create and run a UFT test on the sample custom control before and after deploying the sample toolkit support set to UFT. The procedure described below guides you through this process for the TTrackBar sample. You can perform a similar procedure using the TStringDrawGrid sample.
Use the UFT Object Spy to see how UFT recognizes the TTrackBar control. Create and run a simple test on the control.
You can see that UFT 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.
Deploy the toolkit support set for the TTrackBar control according to the instructions in Deploying the Toolkit Support Set.
Use the UFT Object Spy to see how UFT 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 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 records test steps with the Set operation.
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 do this, perform the following steps:
In Delphi Studio, select Component > Install Component. The Install Component dialog box opens.
In the Unit file name box, specify the full path for the StringDrawGrid.pas file. The file is located in: <UFT installation folder>\samples\DelphiGridExtSample\Application.
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.
Close the Package dialog box, and click Yes in the save confirmation box that opens.