Implementing the IRecordable interface
The following steps were performed to implement the IRecordable interface:
In the TEASampleTestableImp.h file, the following steps were performed to define that the QuickID Testing Agent implements the IRecordable interface (in addition to the ITestable 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:
The methods in the IRecordable interface (BeginRecording, EndRecording) were declared members of the CTEASampleTestableImp class.
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:
The BeginRecording and EndRecording methods were implemented in the TEASampleTestableImp.cpp file.
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 IRecorderand IRecordSuppressor interface methods.
In the QuickID Testing Agent, the BeginRecording and EndRecording methods are implemented in the CTEASampleTestableImp class. They are implemented as follows:
BeginRecording was implemented to:
Save the received object reference in the class' m_spRecorder data member for use when calling the IRecorder and IRecordSuppressor interface methods.
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.