UFT One interacts with the application's controls by setting and retrieving the published properties provided by the Agent Object and the control itself. UFT One first accesses the published properties of the Agent Object and then, if necessary, the published properties of the Delphi object.
When you develop your Agent Object, design published properties to support the identification properties and test object methods that you defined in the test object configuration file. For example, you can create published properties in your Agent Object to enable access to (public) unpublished member variables of the control.
The following reserved properties are used for the implementation of recording and running tests and components:
Use this prefix for all Agent Object properties designed to implement running UFT One test object methods.
__CellRect, __CellData, and __TableContent
These properties are used to implement support for grid objects. For more information, see Creating Support for Custom Grid Controls.
This property is used to implement support for the UFT One recording capability. For more information, see Supporting the UFT One Recording Capability.
The implementation for recording and running tests and components is described in the following sections
For each identification property that you want to support, make sure there is a published property with the same name in the Delphi control or the Agent Object.
Note: UFT One uses only lowercase letters in identification property names. Therefore, the names of published properties that support identification properties must contain only lowercase letters (even if the identification property name in the test object configuration file contains uppercase letters).
A UFT One user can access the published properties of the Agent Object and the Delphi control using the GetROProperty and SetROProperty methods. In addition, these published properties can be verified using checkpoints in a UFT One test and viewed in the Object Spy.
If a property name begins with a double underscore ('__'), it is not displayed in the Object Spy and cannot be accessed by checkpoints or output values. Such hidden properties can be accessed by the GetROProperty and SetROProperty test object methods, and can be accessed directly in user defined functions created in UFT One.
For each test object method that you want to support, create a published property named __QTPReplayMtd_<Test Object Method Name> in the Agent Object. For example, a published property named __QTPReplayMtd_MyTOMethod provides the implementation for running the MyTOMethod test object method.
An Agent Object must implement the __QTPRecording published property to support the UFT One recording capability.
During a recording session, when an event occurs on a custom Delphi control, UFT One sends the Windows message to the Agent Object and queries the __QTPRecording property to retrieve the corresponding line to add to the test or component.
In most cases, you do not have to implement this property in your extensibility code. If you want to create an Agent Object that supports recording, have your Agent Object inherit from the TMicRecordableAO base class.
The TMicRecordableAO agent object base class implements __QTPRecording to perform the following:
Process the parameters passed by UFT One.
Call the ProcessMessage function to determine what step to record for the event that occurred (and the recording mode).
Convert the recording information to the format required by UFT One.
In the Agent Object that you develop, you need only implement the ProcessMessage function.
When UFT One accesses the __QTPRecording property, it passes the window message parameters and window handle to the Agent Object, and expects in return, an array (of type safearray) that contains the recorded step information (the operation and its arguments) and the recording mode. For more information on recording modes, see <UFT One installation folder>\dat\Extensibility\Delphi\AgentExtensibilitySDK.pas.
Output safearray format:
Test object method to record
Test object method arguments
Note: If you create a custom test object class to support the custom control, you can use the ExtObjRecFilter attribute in the toolkit configuration file to specify the level of events that trigger recording. For more information, see Mapping Test Object Classes to Inner Objects.