Sometimes I need to debug into SWT Bot. Since the controls need to be in
foreground for SWT Bot to find them, stepping over something like bot.table()
would throw WidgetNotFoundException.
So I thought, lets set the parameter net.sf.swtbot.search.timeout to something
like 3 seconds. Then I have time to put the application in front after clicking
on "step over".
This would work for bot.button(...), but it does not work for bot.table().
Here is the current code piece, which shows why this is:
public SWTBotTable table(int index) throws WidgetNotFoundException {
List findControls = finder.findControls(new ClassMatcher(Table.class));
if (findControls.isEmpty())
throw new WidgetNotFoundException("Could not find any table");
return new SWTBotTable((Table) findControls.get(index));
}
The wait method will not be called this way. This is how it would be called
inside the super constructor.
public SWTBotTable table(int index) throws WidgetNotFoundException {
return new SWTBotTable(finder, index);
}
Something like that would implement the timeout policy more deeply. I don't
know why this piece of code is not implemented in a similiar way like
bot.button(...), but I think that would work.
I didn't provide a patch because I don't know if there have been reasons for
implementing it like this.
Another solution might be to use the wait method in
ControlFinder.findControls(...) or inside another more central method for that
purpose.
Are you accepting that ideas (infact two different solutions) as a improvement?
-------------------------------------------------------------------------
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08
_______________________________________________
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