Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » SWTBot » why waitUntilWidgetAppears()?
why waitUntilWidgetAppears()? [message #33139] Wed, 22 April 2009 23:32 Go to next message
David Crawshaw is currently offline David CrawshawFriend
Messages: 3
Registered: July 2009
Junior Member
In the bot interface there is:

waitUntil(ICondition)
waitUntilWidgetAppears(ICondition)

Why does there need to be a separate function for widget appearance, given
they both take an ICondition? Can one not write:

Widget w;
bot.waitUntil(Conditions.waitForWidget(Matchers.equalTo(w))) ;

d.
Re: why waitUntilWidgetAppears()? [message #33174 is a reply to message #33139] Thu, 23 April 2009 00:31 Go to previous messageGo to next message
Ketan Patel is currently offline Ketan PatelFriend
Messages: 68
Registered: July 2009
Member
If you look at the source waitUntilWidgetAppears just calls waitUntil and
encapsulates Timout exception into WidgetNotFoundException. This is most
likely because of existing API.

public void waitUntilWidgetAppears(ICondition waitForWidget) {
try {
waitUntil(waitForWidget);
} catch (TimeoutException e) {
throw new WidgetNotFoundException("Could not find widget.", e);
//$NON-NLS-1$
}
}
Re: why waitUntilWidgetAppears()? [message #33282 is a reply to message #33174] Thu, 23 April 2009 06:47 Go to previous message
Ketan Padegaonkar is currently offline Ketan PadegaonkarFriend
Messages: 873
Registered: July 2009
Senior Member
This was primarily to 'cast' the TimeoutException to a
WidgetNotFoundException.

I'm also considering changing this method to accept a
WaitForObjectCondition instead of an ICondition to make this distinction
clear. Also WaitForObjectCondition provides for better convenience apis.

-- Ketan

Ketan Patel wrote:
> If you look at the source waitUntilWidgetAppears just calls waitUntil
> and encapsulates Timout exception into WidgetNotFoundException. This is
> most likely because of existing API.
>
> public void waitUntilWidgetAppears(ICondition waitForWidget) {
> try {
> waitUntil(waitForWidget);
> } catch (TimeoutException e) {
> throw new WidgetNotFoundException("Could not find widget.",
> e); //$NON-NLS-1$
> }
> }
>
Previous Topic:opening project properties hack
Next Topic:Can SWT-Bot test RCP-based applications?
Goto Forum:
  


Current Time: Fri Mar 29 00:54:06 GMT 2024

Powered by FUDForum. Page generated in 0.03746 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top