Stage 3: Registering the Testing Agent to UFT One

A Testing Agent extends the UFT One testing abilities for the environment it supports, by interfacing between UFT One and the application being tested. However, for UFT One to communicate with the Testing Agent, the Testing Agent must be registered.

When UFT One opens, it checks for registered Testing Agents and displays their environments in the Add-in Manager. The UFT One user can select an environment, instructing UFT One to load support for that environment by launching the Testing Agent COM object. When UFT One launches the Testing Agent, it calls the GetTestingEnvironment method discussed in Stage 2: Introducing the Environment to UFT One.

The UFT One Testing Extensibility SDK includes the TeaSDK.lib library, located in <UFT One Testing Extensibility SDK installation folder>\SDK\lib\<VS version>\ folder. This library provides the RegisterTeaAut and UnRegisterTeaAut functions that you can use to register and unregister the Testing Agent.

When you develop your Testing Agent you must link the TeaSDK.lib library and include the RegisterAut.h file (located in <UFT One Testing Extensibility SDK installation folder>\SDK\include folder).

For the QuickID Testing Agent, registration was handled in the CTEASampleApp::InitInstance() method (in the TEASample.cpp file), which is used to run the QuickID application. Look at the relevant code in the section of the method that begins with Register/Unregister TEA Application. You can see that when the QuickID application is run with the /register or /unregister switch, the application is not invoked. Instead, the Testing Agent is registered or unregistered (by calling RegisterTeaAut or UnRegisterTeaAut), depending on the switch. For more information on using the registration methods, see Registering Your Testing Agent.

Note: In the TEASample implementation, running the application with the register switch both registers the application with UFT One and registers the Testing Agent COM object to the operating system. This is not a necessary feature of a Testing Agent implementation. In other implementations, registering the COM object with the operating system may need to be handled separately.