I have developed a runner module for my automation framework which will allow testers author and execute the tests using Eclipse IDE.
Now I am looking to add a module to connect to QC and upload my tests to the respective test plan. For this I am using qcutils.jar.
My Code:
public static void QCConnect()
{
File fUser = new File("lib");
File fNat = new File(fUser, "jacob-1.18-x64.dll");
// Set java library path at runtime
String javaPath = System.getProperty("java.library.path");
javaPath = javaPath+";"+fUser.getAbsolutePath()+";";
System.setProperty("java.library.path", javaPath);
String javaPath1 = System.getProperty("java.library.path");
// Load dll
System.load(fUser.getAbsolutePath()+"\\jacob-1.18-x64.dll");
IQcConnection conn = QcConnectionFactory.createConnection("https://<myqc>/qcbin");
conn.connect("user", "pass", "domain", "project");
TestClient tc = conn.getTestClient();
Test t = new Test();
t.setTestFolder(TestFolder.ROOT_FOLDER + "\\Demo");
t.setDescription("This is a QcTools4j Test");
t.setStatus("Design");
t.setName("myTest");
tc.saveTest(t)
}
Encountered Exception:
org.qctools4j.utils.DllLoader loadLibrary
SEVERE: DLL not found in the class path!
Exception in thread "main" org.qctools4j.exception.QcException: Can't get object clsid from progid
at org.qctools4j.clients.QcConnectionImpl.initConnection(Unknown Source)
at org.qctools4j.clients.QcConnectionImpl.<init>(Unknown Source)
at org.qctools4j.QcConnectionFactory.createConnection(Unknown Source)
at QCJavaConnect.main(QCJavaConnect.java:37)
Caused by: com.jacob.com.ComFailException: Can't get object clsid from progid
at com.jacob.com.Dispatch.createInstanceNative(Native Method)
at com.jacob.com.Dispatch.<init>(Dispatch.java:99)
at com.jacob.activeX.ActiveXComponent.<init>(ActiveXComponent.java:58)
at org.qctools4j.clients.QcConnectionImpl.initConnection(Unknown Source)
... 3 more
I am a looking for a solution on handling QC using java, I do not mind using any other java package.
Thanks in Advance!