Using OTA Client with Java to Links test from testplan to test lab
Our group has it's results for our automated tests in json files. There has been a request to parse these results and insert them into QC. I'm able to get the tests into testplan but unable to link a new test to test lab. I'm trying to write this script in java using the com4.jar along with the com.mercury.qualitycenter.oatclient-9.2.jar
I have been searching around and the documentation says to use TSTestFactory. I have not seen that this interface ITSTestFactory is available using the jars that I have. Does anyone know if this interface is available in a different jar or have an example of linking testcases in testplan to testlab?
Here's the .net example:
TSTestFactory testInstanceF = (TSTestFactory)ts.TSTestFactory;
System.Diagnostics.Debug.Print("Executed testInstanceF in QCAddTest");
TSTest tstInstance = (TSTest)testInstanceF.AddItem(Test.ID.ToString());
System.Diagnostics.Debug.Print("Executed tstInstance in QCAddTest");
System.Diagnostics.Debug.Print("Executed tstInstance Post in QCAddTest");
If the JAR does not contain TSTestFactory then you should probably look for a different JAR or look into using the REST API if it exposes this functionality. If neither of these work out build a .NET application or use a VBS that you can call through a Java app.
What version of QC are you using? ameehl mentioned using the REST API, but that is available only with v11 or newer.
I've not tried writing code to interface with the API, so I can't address that aspect of your question. However, here's a few things to think about.
A TSTest object is the same as a test in the test lab - a Test in a Test Set.
In order to put a test into the test lab you have to have a Test Set to put it in. Do you already have a Test Set created?
In order to create a Test Set you would need to use the TestSetFactory.
In order to put a Test Set into the Test Lab, you have to have a Folder to put that Test Set in. Do you already have a Folder in the Test Lab?
I don't remember the name of the object/factory for making a Folder in the Test Lab, but the details should be available in the API reference document.
(Opinions and information contained in this post are wholly my own and do not reflect the opinions of my employer.)
I'm using QC10. The issue is linking existing tests from testlab into existing testset. The documentation for vb calls for you to use: TSTestFactory but the java interface does not exist for this: ITSTestFactory. I did a search for this class and it looks like there's no such supported class.
I'd rather not call vb/.net code via java. Any other interfaces that would work to do this?
The jar files I'm using are com4j.jar,com.mercury.qualitycenter.otaclient-9.2.jar,QcTools4j-0.2.4.jar.
anny news on this subject?
I have almost the same problem. My testautomation is written in selenium&java and i want to put the results into the testlab, together with the step name, description and expected result from the testplan.
I'm using QC 10 and the 32 bit version of java 1.7.0_25.