Implementing the IRecordable interface

This topic describes the steps that were performed to implement the IRecordable interface.

Declaring that Testing Agent Implements 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:

        COM_INTERFACE_ENTRY(IRecordable)

  • The methods in the IRecordable interface (BeginRecording, EndRecording) were declared members of the CTEASampleTestableImp class.

Back to top

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:

#include "QtpInterface.h"

Back to top

Implementing The IRecordable Interface Methods

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 IRecorder and IRecordSuppressor interface methods.

In the QuickID Testing Agent, the BeginRecording and EndRecording methods are implemented in the CTEASampleTestableImp class. They are implemented as follows:

Back to top