Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » SWTBot » Unexpected WidgetNotFoundException in bot.editors()
Unexpected WidgetNotFoundException in bot.editors() [message #32042] Sun, 12 April 2009 20:53 Go to next message
Matthew Gilliard is currently offline Matthew GilliardFriend
Messages: 3
Registered: July 2009
Junior Member
@Test
public void testEditors(){

SWTEclipseBot bot = new SWTEclipseBot();
assertTrue( "There are no editors open on startup", bot.editors().size()
== 0 );

}

I expect the above test to pass, as there are no open editors. But a
WidgetNotFoundException is thrown instead. Am I misunderstanding
something? It is (very slightly :) cumbersome to have to check if the
exception is thrown, so I'd rather not. Same thing happens with views(),
too.

Matthew
Re: Unexpected WidgetNotFoundException in bot.editors() [message #32078 is a reply to message #32042] Sun, 12 April 2009 21:33 Go to previous messageGo to next message
Matthew Gilliard is currently offline Matthew GilliardFriend
Messages: 3
Registered: July 2009
Junior Member
In fact, I get that same exception, even when there are editors open, so I
have a different problem than I first said. Sorry.

My bot opens a file thru the menus, then I try to call

bot.editors();

I can see the app sitting there with an editor open, but eventually it
times out and throws exception. I can see that it is looking for
IEditorReferences - do I have to add them into my app myself?

cheers,

Matthew
Re: Unexpected WidgetNotFoundException in bot.editors() [message #32114 is a reply to message #32078] Sun, 12 April 2009 22:15 Go to previous messageGo to next message
Matthew Gilliard is currently offline Matthew GilliardFriend
Messages: 3
Registered: July 2009
Junior Member
A little digging:

The problem seems to be in SWTBotEclipseEditor - the constructor assumes
that an editor has a StyledText widget - which mine doesn't...

bot.editor( name );
and
bot.editors();

both work if I add an invisible StyledText to my EditorPart. Except if
there are no editors open, then bot.editors() still throws the exception.

Matthew
Re: Unexpected WidgetNotFoundException in bot.editors() [message #32149 is a reply to message #32114] Mon, 13 April 2009 03:44 Go to previous message
Ketan Padegaonkar is currently offline Ketan PadegaonkarFriend
Messages: 873
Registered: July 2009
Senior Member
Hi Matthew

There is an open bug[1] about similar to this particular case. The bug
that we're currently working on[2] will be fixing this assumption.

[1] - https://bugs.eclipse.org/bugs/show_bug.cgi?id=260088
[2] - https://bugs.eclipse.org/bugs/show_bug.cgi?id=271630

-- Ketan

On 13/4/09 03:45, Matthew Gilliard wrote:
> A little digging:
>
> The problem seems to be in SWTBotEclipseEditor - the constructor assumes
> that an editor has a StyledText widget - which mine doesn't...
>
> bot.editor( name );
> and
> bot.editors();
>
> both work if I add an invisible StyledText to my EditorPart. Except if
> there are no editors open, then bot.editors() still throws the exception.
>
> Matthew
>
Previous Topic:org.apache.commons.collections.
Next Topic:Error while running an swtbot testcase even though the testcase seems to run.
Goto Forum:
  


Current Time: Fri Apr 19 11:53:32 GMT 2024

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

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

Back to the top