Issue in waiting for tree expansion [message #635771] |
Wed, 27 October 2010 23:47  |
Eclipse User |
|
|
|
Hi,
In my UI automation test, I wanted to have wait conditions for a tree expansion. My UI test progress thru expanding a tree structure and its sub nodes. A proper wait has to be provided in each expansion of node since it connects to a backend server to fetch the subnodes. So here I am trying alternate of sleep() command which is waitUntil(). But its not working for me. Please find below the syntax.
-------------
treeItem1.expand();
//sleep();
bot.waitUntil(new WaitForItemExpansion(treeItem1), 15000);
//bot.waitUntil(Conditions.widgetIsEnabled(treeItem1.getNode (0)), 15000);
swtLogger.info ("Folder expanded");
---------------
Here, as an alternate of sleep(), I tried the command in 4th line which is not working. I am waiting till I find a subnode in position 0. What is wrong here?
Then I tried to create a class WaitForItemExpansion which implements ICondition and then the test method of this class has the below syntax.
@Override
public boolean test() throws Exception {
//return treeItem1.isExpanded();
if (treeItem1.getNode(0)!= null)
return true;
else
return false;
}
Though the waitUntil() is executing the ICondition.test by checking the return boolean of isExpanded() or getNode(0) which I can see while debugging mode, the test simply NOT waiting when I execute the script in normal mode.
Please could you let me know what is wrong with this? Please share your thoughts if you have implemented the waitUntil() while expanding a tree.
|
|
|
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.05477 seconds