I have an ultratree object, and I am wondering how do I find/get the selected node(s)/path?
I can't find any getSelectedNode or anything with "select" in it. There is getChildNodes and such, but nothing that seems to be unique to the selected node(s)/path that I can see off-hand.
Nor do I know where there is more documentations on TestAdvantage object/proxy save here.
Thanks ahead of time for your help.
PS: the ultratree contains nodes which when clicked, takes me to various pages/locations within the AUT. I need to know where I currently am (selected node(s)) and go to a given node(s)/path. The second part I got, it's the first I don't know.
Shaule,
Thanks for sharing the java code. I"ll follow up on the other post regarding the "Click(AtPath... " issue.
Ammar
For those like myself that are using Java Scripting, instead of VB, the java code is attached since I can't paste it in a readable format here.
PS: MainTreeTree().click(atPath(path)) doesn't work for me. But I will open another entry for that.
Hi Shaule,
The tree proxy has a verification point that return the Active Node hierarchy as a TestDataTree object. you can use the following code to loop through the TestDataTree node and calculating the node path:
Dim data As Vp.Impl.TestDataTree = MainTreeTree.GetTestData("selected node hierarchy")'GetRoot node from the hierarchyDim node As Vp.Impl.TestDataTreeNode = data.GetTreeNodes().GetRootNodes()(0)Dim path As String = node.GetNode().ToString() While node.GetChildCount() > 0 node = node.GetChildren()(0) path = path + "/" + node.GetNode().ToString() End WhileLogInfo("Selected NodePath = " + path)
'if you use "->" as delimiter instead of "/" then you could use the path to click on the node
MainTreeTree().Click(AtPath(path))
I hope this will help you.
Let me know if you have any further question and remember to verify this answer if it worked for you so that others can benefit from it