Registering Your Testing Agent
You must register the Testing Agent after UFT One is installed. If your application installation installs and registers the agent before UFT One is installed, repeat the registration after installing UFT One.
Registration API methods
The UFT One Testing Extensibility SDK provides C functions that you can use to register and unregister the Testing Agent, and to check whether UFT One is installed. Create an application that uses these functions to register and unregister your agent. Your code must:
Link to the <Testing_Extensibility_SDK_installdir>\SDK\lib\<VS version>\TEASDK.lib library
Include < Testing_Extensibility_SDK_installdir>\SDK\include\RegisterAUT.h
Using the RegisterTeaAut function
Call RegisterTeaAut when you install the Testing Agent.
long RegisterTeaAut (const wchar_t* environmentID, const wchar_t* szEnvDisplayName, const wchar_t* progid);
The function returns ERROR_SUCCESS
(0) if it succeeds in registering the Testing Agent.
It receives the following null-terminated, Unicode, string arguments:
environmentID. The name that UFT One uses to identify your testing environment. The value of this argument must be the same as the PackageName attribute (TypeInformation element) in the Environment XML file.
szEnvDisplayName. The name of the environment that UFT One displays to the user in dialog boxes that display a list of supported environments. The value of this argument must be the same as the AddinName attribute (TypeInformation element) in the Environment XML file.
progid. The program ID with which the Testing Agent COM object registered on the computer. UFT One uses this program ID to launch the Testing Agent.
Using the UnRegisterTeaAut function
Call UnRegisterTeaAut when you uninstall the Testing Agent.
long UnRegisterTeaAut (const wchar_t* environmentId);
The function returns ERROR_SUCCESS
(0) if it succeeds in unregistering the Testing Agent.
It receives the following (null-terminated Unicode string) argument:
environmentID. The environment ID that was used to register the Testing Agent.
Checking Whether UFT One Is Installed
If you want to avoid installing or registering the Testing Agent when UFT One is not installed on the computer, you can check whether UFT One is installed on the computer using function IsQTPInstalled.
long IsQTPInstalled();
This function returns ERROR_SUCCESS
(0) if UFT One is installed.