expandNode with 0 delays [message #498391] |
Mon, 16 November 2009 17:34 |
Jay Norwood Messages: 155 Registered: July 2009 |
Senior Member |
|
|
I came upon a sequence that appears to avoid putting in arbitrary sleep() times for those expandNode calls that take a long time to complete and sometimes get stuck.
i had previously put in the SWTBotTreeItem.getParent() function to back up to a node's parent. I find now that using it has worked consistently to get rid of stuck expandNode calls. For example, the Run/Debug expandNode would frequently get stuck in the test when expanding, but with the repeat expandNode following the .getParent() in the code below, I haven't had it stuck now for the two weeks I've been using it with 0 PLAYBACK_DELAY. Maybe there would be a use for this sort of recovery in a waitUntil test, because I've found that once stuck the expandNode failure doesn't recover with just repeated tests with just sleep().
// Open the global preferences panel through the toolbar
bot.menu("Window").menu("Preferences").click();
SWTBotShell prefsShell = bot.shell("Preferences");
prefsShell.activate();
// Get a particular preference panel setting through the global preferences panel tree
SWTBotTreeItem treeItem = bot.tree().expandNode("Run/Debug").getParent().expandNode( "Run/Debug").select().click();
|
|
|
Powered by
FUDForum. Page generated in 0.03795 seconds