SWTBot runs very fast, but I have seen a piece of code, where time is lost.
public SWTBotTableItem getTableItem(final String itemText) throws
WidgetNotFoundException {
try {
new SWTBot().waitUntil(new DefaultCondition() {
public String getFailureMessage() {
return "Could not find node with text " + itemText;
}
public boolean test() throws Exception {
return getItem(itemText) != null;
}
});
} catch (TimeoutException e) {
throw new WidgetNotFoundException("Timed out waiting for table item
" + itemText, e);
}
return new SWTBotTableItem(getItem(itemText));
}
The method getItem(itemText) is called twice. Once for determining whether the
widget exists and again for returning the widget.
I suggest that the waitUnit(...) method returns the widget if it finds it, so
it does not need to be searched again.
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
SWTBot-users mailing list
SWTBot-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/swtbot-users
http://swtbot.org/ - a functional testing tool for SWT/Eclipse