Connect to HP Quality Center using Java and com4j – Tutorial (part 1)
I try to add some new information about how to connect to Quality Center using Java.
I will complete a step by step tutorial from the creation of the basic classes to the querying of the bugs.
In this first tutorial I show how to create the classes needed to connect your program to QC using the OtaClient.dll. OtaClient is not a java library and cannot used directly by our program, we need to create a wrapper that translate our request to a native language. To do this the fastest method is to use Com4j
1. Find the OtaClient.dll
You should find the OtaClient.dll in the following folder:
c:Program Files (x86)Common FilesMercuryInteractiveQuality Center
If you cannot find the library try to use the search features of Windows. This library is required to communicate to the server.
2. Download com4j
When you downloaded the library you have to unzip it. As example I unzipped it in the dev folder.
3. Use com4j to generate a library with the wrapped classes
Because com4j is not compatible with 64 bit systems, use a 32 bit JRE or you will get:
Execute the tblimp.jar with a 32-bit JRE, you can use the following parameters:
-o is for the destination directory
-p is for the java package of destination
You could have few warning:
but at the end you should have your the sources ready under hpqc/com/qc:
You can import these sources to connect and use QC from your application.