Skip to main content



      Home
Home » Eclipse Projects » SWTBot » Accessing "View Menu"?
Accessing "View Menu"? [message #536684] Sat, 29 May 2010 16:05 Go to next message
Eclipse UserFriend
I need help accessing the "View Menu", the triangle icon next to the
minimize and maximize icons. I need to be able to test things like
presence of menu items and to click them to confirm their action. An
example would be great.

Thanks,
Craig
Re: Accessing "View Menu"? [message #537149 is a reply to message #536684] Tue, 01 June 2010 09:10 Go to previous messageGo to next message
Eclipse UserFriend
Hi,

[bot].viewByTitle("your view").menu("label in the menu").click();

An exception is thrown if the "label in the menu" doesn't exists.

Etienne

Le 29/05/2010 22:05, Craig Foote a écrit :
> I need help accessing the "View Menu", the triangle icon next to the
> minimize and maximize icons. I need to be able to test things like
> presence of menu items and to click them to confirm their action. An
> example would be great.
>
> Thanks,
> Craig
Re: Accessing "View Menu"? [message #537322 is a reply to message #537149] Tue, 01 June 2010 19:50 Go to previous messageGo to next message
Eclipse UserFriend
For a negative test (where any widget does not exist):

try{
bot.view().menu("whatever");
}catch (WidgetNotFoundException e){ }

--
Ketan
http://ketan.padegaonkar.name | http://eclipse.org/swtbot

On 6/1/10 6:40 PM, Etienne wrote:
> Hi,
>
> [bot].viewByTitle("your view").menu("label in the menu").click();
>
> An exception is thrown if the "label in the menu" doesn't exists.
>
> Etienne
>
> Le 29/05/2010 22:05, Craig Foote a écrit :
>> I need help accessing the "View Menu", the triangle icon next to the
>> minimize and maximize icons. I need to be able to test things like
>> presence of menu items and to click them to confirm their action. An
>> example would be great.
>>
>> Thanks,
>> Craig
>
Re: Accessing "View Menu"? [message #538532 is a reply to message #536684] Mon, 07 June 2010 17:29 Go to previous messageGo to next message
Eclipse UserFriend
Thanks for replying but this is still not working for me. I've debugged through to ViewMenuFinder#getMenuItemsInternal where it iterates over the menu items looking for the match. Its two checks for MenuManager and ActionContributionItem both fail so my menu item is not found. My item is in the list iterated over but it is a SubContributionItem with an "innerItem" that is the sought ActionContributionItem.

If it helps, the menu item I'm looking for is an Action contributed to the PropertySheet via a custom IPropertySheetPage implementation's #setActionBars. That method is provided an IActionBars from which I get the IMenuManager to which I add the Action.

I'm wondering if the nature of PageBooks and how they contribute to the host view's menu is a factor here. Either way, I can't see how that method can return my menu item as is. So I guess either I'm doing something really wrong or I've found a bug.

Any ideas greatly appreciated.

Craig
Re: Accessing "View Menu"? [message #538570 is a reply to message #538532] Mon, 07 June 2010 22:46 Go to previous messageGo to next message
Eclipse UserFriend
On 6/8/10 2:59 AM, Craig Foote wrote:
> Thanks for replying but this is still not working for me. I've debugged
> through to ViewMenuFinder#getMenuItemsInternal where it iterates over
> the menu items looking for the match. Its two checks for MenuManager and
> ActionContributionItem both fail so my menu item is not found. My item
> is in the list iterated over but it is a SubContributionItem with an
> "innerItem" that is the sought ActionContributionItem.

Could you write a small snippet in the SWTBot tests[1] to reproduce this
? It'd be of great help for me to implement what's missing.

--
Ketan
http://ketan.padegaonkar.name | http://eclipse.org/swtbot

[1] - http://goo.gl/wOin
Re: Accessing "View Menu"? [message #538574 is a reply to message #538570] Mon, 07 June 2010 23:32 Go to previous messageGo to next message
Eclipse UserFriend
Sure, what's the "SWTBot tests[1]"?
Re: Accessing "View Menu"? [message #540115 is a reply to message #538574] Mon, 14 June 2010 21:39 Go to previous messageGo to next message
Eclipse UserFriend
On Mon, 07 Jun 2010 23:32:12 -0400, Craig Foote wrote:

> Sure, what's the "SWTBot tests[1]"?

bump
Re: Accessing "View Menu"? [message #540266 is a reply to message #540115] Tue, 15 June 2010 09:41 Go to previous messageGo to next message
Eclipse UserFriend
On 10-06-14 09:39 PM, Craig Foote wrote:
> On Mon, 07 Jun 2010 23:32:12 -0400, Craig Foote wrote:
>
>> Sure, what's the "SWTBot tests[1]"?
>
> bump

[1] - http://goo.gl/wOin

It was hidden in Ketan's signature :P
--
Pascal Gélinas | Software Developer
*Nu Echo Inc.*
http://www.nuecho.com/ | http://blog.nuecho.com/

*Because performance matters.*
icon10.gif  Re: Accessing "View Menu"? [message #540386 is a reply to message #540266] Tue, 15 June 2010 19:42 Go to previous messageGo to next message
Eclipse UserFriend
D'oh! Sorry about that. I'm new to git so this might take a while. I assume I do a fork to create my own repo and somehow push back to you?
Re: Accessing "View Menu"? [message #540388 is a reply to message #540386] Tue, 15 June 2010 19:56 Go to previous message
Eclipse UserFriend
On 6/15/10 4:42 PM, Craig Foote wrote:
> D'oh! Sorry about that. I'm new to git so this might take a while. I
> assume I do a fork to create my own repo and somehow push back to you?

In case you're not comfortable with git, you can use SVN instead.

See http://wiki.eclipse.org/SWTBot/Contributing

--
Ketan
http://ketan.padegaonkar.name | http://eclipse.org/swtbot
Previous Topic:...\plugins\org.eclipse.test\JUNIT.XSL doesn't exist
Next Topic:How to insert text into a text editor tab of a multipage editor?
Goto Forum:
  


Current Time: Thu Jul 10 02:58:13 EDT 2025

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

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

Back to the top