Skip to main content



      Home
Home » Eclipse Projects » SWTBot » why waitUntilWidgetAppears()?
why waitUntilWidgetAppears()? [message #33139] Wed, 22 April 2009 19:32 Go to next message
Eclipse UserFriend
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] Wed, 22 April 2009 20:31 Go to previous messageGo to next message
Eclipse UserFriend
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 02:47 Go to previous message
Eclipse UserFriend
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: Mon Jun 16 19:25:32 EDT 2025

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

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

Back to the top