Question

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.

Was it helpful?

Solution

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top