The below code is the solution, it will create the folder structure similar to the input "testPlanPath"
Set tdc = TDConnection Set treeMng = tdc.TreeManager Set TestNode = treeMng.nodebypath(testPlanPath) Set TestFact = TestNode.TestFactory Set TestsList = TestFact.NewList("") Set TStreeMng = tdc.TestSetTreeManager testLabPath = "Root" testLabPathx = Split(testPlanPath,"\") testSetName = testLabPathx(tsIndex) Set myRoot = TStreeMng.Root For each z in testLabPathx If z <> "Subject" And z <> testSetName then testLabPath = testLabPath + "\" + z newNode = myRoot.addNode(z) Set myRoot = TStreeMng.NodeByPath(testLabPath) End If Next