Hi,
I'm using TreeManager.getNodeByPath for verifying if a node path exists, if not I browse recursively the path up to find the node from where I need to recreate the missing subfolders.
Function GetParentNodeID(strFullPath) as Long
'''' ..some code before.. '''' On Error Resume Next Set objFolder = objTreeManager.NodeByPath(strFullPath) If Err.Number And Not Err.Number = ALM_ERROR_TEST_NODE_NOTFOUND Then Err.Raise Err.Number, Err.Source, Err.Description If objFolder Is Nothing Then nLen = Len(strFullPath) nPos = InStrRev(strFullPath, "\") strPath = Left(strFullPath, nPos - 1) strFolder = Right(strFullPath, nLen - nPos) nNodeId = GetParentNodeID(strPath) Set objFolder = objTreeManager.NodeById(nNodeId).AddNode(strFolder) End If GetParentNodeID = objFolder.NodeID End Function
In the Test Plan, I have the following folder structure:
Subject --->0-LEGACY ------>Product2015_04_JUNE_19 --------->SAN ------------>TT012345-PR0001-International Access ZYX --------------->Change Scenario ------------------>Case01-Access creation using Wapz --------------------->Sub Case 01 - Business User REP ------------------------>Client 01 - External Client --------------------------->Components
If I'm using getNodePath with the path "Subject\Product2015_04_JUNE_19\SAN\TT012345-PR0001-International Access ZYX\Change Scenario\Case01-Access creation using Wapz\Sub Case 01 - Business User REP\Client 01 - External Client\Components" (the top folder 0-LEGACY is omitted), the function returns the existing node "Components" from the structure above when I'm expecting an error "Node not found".
As an alternative, I also tried to use the function GetSubjectNodeByPath provided in the documentation but I face the same issue.
Any idea how to solve this issue?