Quality Center Support and News
Showing results for 
Search instead for 
Do you mean 

QC OTA : How to get TestLab Path from a Test Object [VBScript]

Occasional Advisor

QC OTA : How to get TestLab Path from a Test Object [VBScript]

Hi Team,

 

Im working on exporting defect details from QC using OTA in VBScript.

 

I traversed from tdc to Test object. Now I need a way to extract the full path of the test in test lab.

 

Im using QC 11.0

 

Thanks in advance.

7 REPLIES
Honored Contributor

Re: QC OTA : How to get TestLab Path from a Test Object [VBScript]

The Test object is the test case in the Test Plan module. The instances of tests in the Test Lab module are TSTest objects. In order to get the path in the Test Lab for Test Instances that correspond to your Test Plan Test Case, you must first get the Test Instances (TSTest objects) that correspond to that Test Case.

The ID of the Test Plan Test object is contained in each instance of that test in the Test Lab in the TSTest object's property TestId. Look at using a Filter to retrieve the TSTest objects that correspond to your Test object.

Once you have the TSTest object, then you can trace backwards to get the Test Set (TestSet object) that contains that test instance. From the TestSet object you can get the TestSetFolder object, whic is the folder in the Test Lab that contains the Test Set. Once you have the TestSetFolder object, you can get the full path to that folder by looking at the object's Path property.
[If this post solves or helps solve your issue, mark the thread as solved and give KUDOS to the author for their assistance.]

(Opinions expressed in my postings are mine alone, and do not reflect the opinions of my employer.No warranties express or implied for any solution/suggestion posted.)
Occasional Advisor

Re: QC OTA : How to get TestLab Path from a Test Object [VBScript]

Thanks for your Quick Reply.

 

I got the TSTest object now. But Im not able to extract the Test lab Path.

 

It would be grateful if you can share the code [ from the TSTest Object to extracting the Testlab Path ]

 

Thank you

Honored Contributor

Re: QC OTA : How to get TestLab Path from a Test Object [VBScript]

As I said, trace backward. All the information is available in the API documentation.

If you have the TSTest object refer to its TestSet Property to get a pointer to the test set (TestSet object) that contains the test instance.

When you have the TestSet object you can look at its TestSetFolder Property to get a pointer to the folder in the lab (TestSetFolder object) that contains the Test Set.

Once you have the TestSetFolder object, review the available properties for the object to figure out how to build the path to that folder.
[If this post solves or helps solve your issue, mark the thread as solved and give KUDOS to the author for their assistance.]

(Opinions expressed in my postings are mine alone, and do not reflect the opinions of my employer.No warranties express or implied for any solution/suggestion posted.)
Occasional Advisor

Re: QC OTA : How to get TestLab Path from a Test Object [VBScript]

[ Edited ]

I tried this: [ TsTest is the TSTest Object ]

 

<code>

 

for each TestSet1 in TsTest.TestSet.NewList("")

   for each Folder1 in TestSet1.TestSetFolder.NewList("")
     
          Path1=Folder1.Path()

 

</code>

 

But its not getting any values.

 

As Im not familiar with OTA, requesting you to provide atleast the first step.

 

from TSTest Object  ->  TestSet Object

 

Thanks

 

Highlighted
Advisor

Re: QC OTA : How to get TestLab Path from a Test Object [VBScript]

pls some one help me here :

 

i am trying to access my BPT testplans from testlab but somewhat i am unable to get. pls help if there is way to get my testplans form testlab directly. i know the way how to get testplan but not from testlab.

 

hi guys pls help soon

Visitor

Re: QC OTA : How to get TestLab Path from a Test Object [VBScript]

I managed to find the Instance item using the TC_TEST_ID filter on TSTestFactory object.

 

Now I need, as you explain, to go backward to the TestSet Object to find the folder of the testset where the instance is.

 

What parameters should I use to filter on the TestSetFactory object ?

Honored Contributor

Re: QC OTA : How to get TestLab Path from a Test Object [VBScript]

If you have the TSTest object, you don't need to filter on the TestSetFactory. The TSTest object includes a property named TestSet, which is the TestSet object for the test set to which the test instance belongs.

 

And the TestSet object includes a property named TestSetFolder.

 

Take a look at the OTA API reference for more information.

[If this post solves or helps solve your issue, mark the thread as solved and give KUDOS to the author for their assistance.]

(Opinions expressed in my postings are mine alone, and do not reflect the opinions of my employer.No warranties express or implied for any solution/suggestion posted.)