0

I am trying to extract sub folders (not all children folders) along with Test sets(not all children test sets, only next test set) from a parent folder in QC test Lab.

Let suppose There are 2 sub folders and 1 test set in a Parent folder in QC:

   -Parent Folder1
      - Sub folder1
      - Sub folder2
      - Test Set

Using the below code i am able to extract the subfolders only not test sets: Code:

Set TsetMgr = UserForm9.QCConnection.TestSetTreeManager  'object required
Set Root1p = TsetMgr.Root 'connect to Root
Set SubNodesRoot = Root1p.SubNodes() 'Using SubNodes method to extract SubNodes from QC
For rp = 1 To SubNodesRoot.Count 'Total SubNodes available
c1p = SubNodesRoot.Item(rp)' Finding SubNodes
MsgBox(c1p)  ' SubFolder1 and Subfolder2 values are displayed.

Next

My only problem now is, i am not able to extract Test Sets along with subfolders from a parent folder.

Can anyone please help me fix this. Thanks.

GlennV
  • 3,471
  • 4
  • 26
  • 39
Srekk
  • 136
  • 5
  • 15
  • @GlennV, please stop editing questions simply to add a tag which has the same meaning as the existing tag. Instead, bring up the identical tags on [meta]. – Heretic Monkey Sep 29 '16 at 17:48

1 Answers1

1

I don't think there is a way to get both folders and test sets with calling one function. But you can get the folders with the method you described. And you can get the immediate child-test-sets of a TestSetFolder via the TestSetFactory of this folder:

test_set_factory = lab_folder.TestSetFactory
test_sets = test_set_factory.NewList("")
test_sets.each do |test_set|
  puts "Test Set: #{test_set.Name}"
end

That should print you the names of all TestSets in the lab_folder. I think you cannot have TestSets directly in your root folder, so you can use the TestSetFactory only on sub folders.

Josh Crozier
  • 233,099
  • 56
  • 391
  • 304
Roland
  • 1,220
  • 1
  • 14
  • 29