Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
142
Trying to click through UltraTree nodes
posted
It has been mentioned that UltraTree().click(atPath(path)) should work to "navigate" through the tree.

But, it's not. I'm getting various errors.

When the path is "Node1Level1->Node1Level2->Node3Level3", for example. If Node1Level1 isn't expanded, SubitemNotFoundException is thrown. If Node1Level1 is expanded, and I try UltraTree().setState(EXPAND, atPath("Node1Level1")), UnableToPerformActionException is thrown.

There is no "getState" for UltraTree() that I can find, to see if the node is expanded or not.

I have tried:
String[] arPath = Path.split("->");
String finalPath = "";
for (int i = 0; i " + arPath[j];
	else
		finalPath = arPath[0];
	if (i == (arPath.length-1))
		UltraTree().click(atPath(finalPath + "->Location(CAPTION)"));
	else
		UltraTree().setState(EXPAND, atPath(finalPath));
	sleep(2);
}
to click my way through the tree. But as I said, I get those exception thrown.

Not all nodes are expandable, as they don't have children.

Anyone has a better idea?

PS When I try to "ShowTree" from another thread, I got: [code] public void testMain(Object[] args) { UltraTreeTestObject myTree = ; // Variables to hold tree data ITestDataTree CdTree = (ITestDataTree) myTree.getTestData("all tree data"); ITestDataTreeNodes CdTreeNodes = CdTree.getTreeNodes(); ITestDataTreeNode[] CdTreeNode = CdTreeNodes.getRootNodes(); // Print out total number of nodes logInfo("Tree Total Node Count: " + CdTreeNodes.getNodeCount()); logInfo("Tree Root Node Count : " + CdTreeNodes.getRootNodeCount()); // loop through the tree root bands for (int i = 0; i
Parents
No Data
Reply
  • 6729
    Offline posted

    Hi Shaule

    I have tried Click(AtPath(path)) and it worked for me as long as the path is correct. This action took care of expanding and collapsed node in the path. I was using the latest build of TestAdvantage 2009 Vol 1, what version and build number are you using? This might be a fixed bug that was released after product RTM.

    Regarding finding if a node can be expanded or not, I’ve created the attached script to demonstrate this. I’m only looping through the root nodes collection but this script can be modified to recursively loop through all nodes while constructing the paths to test a click on each and every node in the tree.

    Let me know if you need any help

    Ammar

Children