This topic describes the steps that were performed to implement the IRecordable interface.
Declaring that Testing Agent Implements the IRecordable Interface
The following line was added to the CTEASampleTestableImp class inheritance list:
public IDispatchImpl<IRecordable, &__uuidof(IRecordable),&LIBID_AutInterface>
The following line was added to the CTEASampleTestableImp class' COM Map:
Including the UFT Extensibility Agent type library Header File
The following line was added in the TEASampleTestableImp.h file, to enable the Testing Agent to call methods from the UFT Extensibility Agent type library:
Implementing The IRecordable Interface Methods
UFT One calls BeginRecording or EndRecording when the user starts or ends a recording session. The BeginRecording and EndRecording methods can therefore be implemented to initialize or reset variables pertaining to a recording session and to activate or deactivate dynamic recording suppression.
During a recording session, the Testing Agent can instruct UFT One to add steps to the GUI test based on the operations that the user performs on the application. To do this, the Testing Agent calls the Record API callback method that UFT One provides in the IRecorder interface. This interface is defined in the UFT Extensibility Agent type library.
In addition, the Testing Agent can instruct UFT One to refrain from recording native steps on the application, by calling the Suppress/UnSuppress API methods from the IRecordSuppressor interface. For more information, see Recording Test Object Method Steps and Suppressing UFT One Native Recording.
The BeginRecording method receives a reference to an object that exposes the IRecorder and IRecordSuppressor interfaces. The Testing Agent uses this reference to access the IRecorder and IRecordSuppressor interface methods.
BeginRecording was implemented to:
Call the CTEASampleTestableImp::SuppressWindow method, which handles native recording suppression (for more information, see Suppressing and UnSuppressing Native Recording).
EndRecording was implemented to call the CTEASampleTestableImp::UnSuppressWindow method, to turn off the native recording suppression. For more information, see Suppressing and UnSuppressing Native Recording.