hp qc test lab's test set's test cases count (1007 Views)
Reply
Occasional Contributor
kramesh
Posts: 3
Registered: ‎07-23-2010
Message 1 of 4 (1,007 Views)

hp qc test lab's test set's test cases count

Is there any API or method available to get the number of test cases loaded in a particular test set of test lab?
Trusted Contributor
Beate N
Posts: 179
Registered: ‎10-27-2009
Message 2 of 4 (1,007 Views)

Re: hp qc test lab's test set's test cases count

Please see this example from the API documentation:
TestSetTestsList.count will give you the number of Tests in the TestSet.


' Get the TSTest factory and list of TSTests.
Set TSTestFact = theTestSet.TSTestFactory
Set TestSetTestsList = TSTestFact.NewList("")

Dim sID$
For Each theTSTest In TestSetTestsList
i = i + 1: If i > 10 Then Exit For
With theTSTest
Debug.Print "TSTest Name: " & .Name, "ID: " & .ID, _
"TestID: " & .TestID, "Instance: " & .instance
sID = theTSTest.ID 'Save the last ID
End With
Next theTSTest
Honored Contributor
Massimo De Rosa
Posts: 656
Registered: ‎03-02-2009
Message 3 of 4 (1,007 Views)

Re: hp qc test lab's test set's test cases count

Beate is right..

but from the TSTestInstanceList you can return the number just like this:


TSTestInstanceList.Count
Occasional Contributor
kramesh
Posts: 3
Registered: ‎07-23-2010
Message 4 of 4 (1,007 Views)

Re: hp qc test lab's test set's test cases count

If you provide the current test case full path as strPath, then we can find out the number of test cases in a test set as follow.

set testSet = QCConnection.TestSetTreeManager.NodeByPath(strPath)
For each theTest in
testSet.FindTestInstances("")
testCaseCount = testCaseCount+1
Next

My need is to find out number of test cases selected to Run.
I tried with TestSetFactory and RunFactory object properties and methods. There is no clue. Pls help me in this.

Is there any OTA API available to find out number of test cases selected for running(ie, number of test cases in Automatic Runner Dialog)?
The opinions expressed above are the personal opinions of the authors, not of HP. By using this site, you accept the Terms of Use and Rules of Participation.