Uses of the OTA Library
There are several ways to use the ALM Open Test Architecture API: by accessing the TDConnection object from the Workflow module or adding code to VAPI_XP tests, by using the QCUtil object in Quick Test Professional, by using add-ins that give access to the library from third party products, and by developing programs in a programming environment.
For more information about using the Open Test Architecture API from the Workflow module, see the ALM Administrator Guide. For information about the QCUtil object, see the Quick Test Professional documentation. For information about add-ins, see the relevant ALM <third-party product name> Add-in Guide.
Downloading the Library
To use the Open Test Architecture API as a stand-alone tool, develop your own applications in a development environment that supports COM. You must download and register ALMs COM libraries on every workstation that will communicate with the ALM Platform. You must have a reference to the libraries in your application development project.
Download and register the libraries for the server by running the Client Registration add-in: Log in to ALM and select the Tools option. On the Tools page, select ALM Client Registration. At the bottom of the Add-ins Page, run Register ALM.
Always run ALM Client Registration from the version on which your OTA application runs. The OTA library is not backward compatible.
ALM's DLLs are downloaded to the following folder:
C:\Users\<client user name>\AppData\Local\HP\ALM-Client\<server name>
There may be a version of the library at C:\Program Files\Common Files\Mercury Interactive\Quality Center\OTAClient.dll if you are also running Quality Center.
When you create your application development project, add the OTA COM Type Library (OTAClient.dll) to the project references.
Note: Starting from ALM 14.00, the authentication is not handled by ALM but by an external IdP/IdM. The Login and Logout methods were adjusted to provide backward compatibility if you do not develop your own authentication flow to acquire an authentication token to use for ALM APIs from the IdP and IdM. To enable this backward compatibility, you must also reference IdmClientSdk.dll and IdmSdkWrapper.dll in your development project.
Creating a C# project in Microsoft Visual Studio
After running ALM Client Registration (see previous section), create a project and add a COM reference to the "OTA COM Type Library". Add to your code :
See the C# Program Example.
Entry-level Object and Factories
The first action in any project is to create a connection. See the Connections Examples.
Most objects are created and managed with factory objects. The factory necessary to begin a process is obtained from the TDConnection object. The factories that create and manage objects that belong to another object are obtained from the owner object. For example, get the DesignStepFactory used to create DesignSteps for a Test from the Test.DesignStepFactory property.
Many factories can be obtained both from the TDConnection object and from the owner object. In general, the functionality of factories obtained from TDConnection is limited to listing objects of the managed type, returning an object whose ID is known, and creating the top-level object.
Most of the management of objects is done with a factory obtained from the owner, or parent, object. For example, the root of the Component tree is obtained from the TDConnection.ComponentFolderFactory, but new nodes in the tree are created with the ComponentFolderFactory obtained from the parent folder.
Exceptions to this division between connection-level factories and owner-object-level factories are noted in the reference for the specific object or factory.