Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » SWTBot » Extra space needed in name to find a menu item
Extra space needed in name to find a menu item [message #31525] Mon, 06 April 2009 15:08 Go to next message
Anders Baumann is currently offline Anders BaumannFriend
Messages: 55
Registered: July 2009
Member
Hi Ketan.

We are experiencing some strange behaviour when we try to find a menu item
in the "Edit" menu in the main menu. On my machine the following lines of
code works fine:

final SWTBotMenu editMenu = bot.menu("Edit");
editMenu.menu("Undo").click();

However, this code throws a "WidgetNotFoundException" on my colleagues
machine. He needs to add an extra space in the name of the undo menu item.
Like this:

final SWTBotMenu editMenu = bot.menu("Edit");
editMenu.menu("Undo ").click();

Of course this now throws a "WidgetNotFoundException" on my machine. We are
both running on the same version of Eclipse (3.4.2) with the same version of
SWTBot (2.0.0.204-dev).

What are we doing wrong?

Best regards,
Anders
Re: Extra space needed in name to find a menu item [message #31561 is a reply to message #31525] Mon, 06 April 2009 15:39 Go to previous messageGo to next message
Ketan Padegaonkar is currently offline Ketan PadegaonkarFriend
Messages: 873
Registered: July 2009
Senior Member
Hi Anders,

Not sure what's wrong. Perhaps turning on logging[1] will print you
detailed level information about the widgets swtbot finds, and the ones
it matches.

Looking at the WithMnemonic matcher[2], which is used to match the text
on menu items, it does not seem to do any trimming of strings that could
mess things up.

[1] -
http://wiki.eclipse.org/SWTBot/FAQ#How_do_I_configure_log4j_ to_turn_on_logging_for_SWTBot.3F
[2] -
http://github.com/ketan/swtbot/blob/master/org.eclipse.swtbo t.swt.finder/src/org/eclipse/swtbot/swt/finder/matchers/With Mnemonic.java

-- Ketan

On 6/4/09 20:38, Anders Baumann wrote:
> Hi Ketan.
>
> We are experiencing some strange behaviour when we try to find a menu item
> in the "Edit" menu in the main menu. On my machine the following lines of
> code works fine:
>
> final SWTBotMenu editMenu = bot.menu("Edit");
> editMenu.menu("Undo").click();
>
> However, this code throws a "WidgetNotFoundException" on my colleagues
> machine. He needs to add an extra space in the name of the undo menu item.
> Like this:
>
> final SWTBotMenu editMenu = bot.menu("Edit");
> editMenu.menu("Undo ").click();
>
> Of course this now throws a "WidgetNotFoundException" on my machine. We are
> both running on the same version of Eclipse (3.4.2) with the same version of
> SWTBot (2.0.0.204-dev).
>
> What are we doing wrong?
>
> Best regards,
> Anders
>
>
Re: Extra space needed in name to find a menu item [message #31591 is a reply to message #31561] Wed, 08 April 2009 12:34 Go to previous message
Jens  übler is currently offline Jens üblerFriend
Messages: 17
Registered: July 2009
Junior Member
As the undo action is a retarget action it allows for setting the label
dynamically to the operation. I would guess you clicked two different
operations one having an additional label and the other has not.

Maybe it is a starting point for you to dig in.

Jens
Previous Topic:SWTBot application and plugin
Next Topic:Use regular expression for selection
Goto Forum:
  


Current Time: Thu Sep 26 11:35:25 GMT 2024

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

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

Back to the top