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
		Next

 

 

Parents
  • I think you should take the TSTestFactory property of the TDConnection object as your point of departure. From the factory you can get a filtered list of those test instances that refer to a certain test ID.

     

    And the test instance will know which test set it belongs to, and the test set which folder it is located in.

  • Hum yes I see.

    But my point of departure helps me fills my GUI(The TesTPLAN one), that's why I didn't wanted to change it.

     

    I'll will save all my necessary data first, and then switch to TSTestFactory.

     

    Thx :)

  • 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
    Msgbox(1,"Test",$co)

     

    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
      Next

     

Reply Children
No Data