Absent Member.
Absent Member.
5080 views

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

Jump to solution

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

 

 

0 Likes
1 Solution

Accepted Solutions
Fleet Admiral
Fleet Admiral

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

 

Jan Czajkowski

[Please do not contact me off line for receiving support. Use the forum!]

View solution in original post

0 Likes
4 Replies
Fleet Admiral
Fleet Admiral

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.

Jan Czajkowski

[Please do not contact me off line for receiving support. Use the forum!]
0 Likes
Absent Member.
Absent Member.

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 🙂

0 Likes
Absent Member.
Absent Member.

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

0 Likes
Fleet Admiral
Fleet Admiral

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

 

Jan Czajkowski

[Please do not contact me off line for receiving support. Use the forum!]

View solution in original post

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.