OTA QC : How to get Testset/Testset Folder of a test selected in the TestPlan at first.

Hi everyone,

I'm develloping a tool in AutoIT for a project at work and I'm a little bit stuck with the API.

It could be long to explain all the requierements but basicaly it's a test launcher with a lot of "other actions outside of QC".


So far I've managed to :

- Get the list of test contains in defined foldef in the TestPLAN

- Get the INSTANCEID (2 to 4 in my case) of a selected test.


And i'm stuck with that ID... I would need at the end to be able to see all the TestLAB Folder where a selected test from the TestPLAN is used, and then run my test and update status/Comment/... in this folder especialy.


TESTPLAN > Select a test > Get InstanceID > Return TestLab Folder(???)

Kind of the same function that is available in QTP when you start a test, you can select on which instance you wanna launch it.



blablabla connection...

Global $IDTest=$Testset.name ;the name of the test

;Finding the TestINstance for that test
Global $findinstance=$tdc.TestSetTreeManager
	Global $Fol=$findinstance.root
	Global $lis=$Fol.FindTestInstances($IDTest)
	Global $con=$lis.count

		For $t=1 To $con
			Global $InsItem=$lis.item($t)
			Global $InsName=$InsItem.ID
;Result is ID of the instance



Parents Reply Children
  • Hello again,


    After some challenge saving everything I needed and some changes in the requierement i'm back at square 1.


    I'm really not familiar with OTA (first time) and I cannot find the Instance object using my ID.



    Here is what i'm doing :


    ;Switching to TSTestFactory

    Global $findinstance=$tdc.TSTestFactory


    ;$SavedTestInfo[$TestNumber][1] = The test ID
    Global $Fol=$findinstance.Filter($SavedTestInfo[$TestNumber][1])
    Global $Lis=$findinstance.Newlist($Fol)
    Global $con=$Lis.item(1)
    Global $co=$con.name


    The issue is that the filter doesn't apply to the list and I get the very first "name" as result not related at all to my testID.


    What am I doing wrong ?


    Thx in adavance

  • Verified Answer

    I don't understand your code, but here is an example in VBScript of how you can get the test instances for a test with ID #1:


      Set aFilter = TDConnection.TSTestFactory.Filter
      aFilter.Filter("TC_TEST_ID") = 1
      Set testInstances = aFilter.Newlist
      For i = 1 To testInstances.Count
          MsgBox testInstances.Item(i).ID