Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » SWTBot » second level context menu(How can I click on a second level of context menu ?)
second level context menu [message #662296] Wed, 30 March 2011 07:36 Go to next message
shawn  is currently offline shawn Friend
Messages: 9
Registered: February 2011
Junior Member
A tree context menu has a second level menu
And I tried this way

tree.expandNode().getNode().contextMenu().click().menu().cli ck();

this can find the menu
but just for the first time,if I try to visit the menu for second time
I got a "the widget was disposed" exception Sad

Could someone give me a help ?

Re: second level context menu [message #664814 is a reply to message #662296] Tue, 12 April 2011 07:45 Go to previous messageGo to next message
Stefan Schaefer is currently offline Stefan SchaeferFriend
Messages: 2
Registered: April 2011
Junior Member
Hi shawn,
first of all: I'm no crack in SWTBot and I didn't explicitly test your problem Wink

I think you need to remove the first ".click()" to make this work.
The call "contextMenu("xyz")" already moves the cursor on the respective element and another "menu("abc")" call should open the submenu of "xyz" and there go to "abc", which you want to click().

Hope it helps Smile
Re: second level context menu [message #664832 is a reply to message #662296] Tue, 12 April 2011 08:50 Go to previous messageGo to next message
Mariot Chauvin is currently offline Mariot ChauvinFriend
Messages: 174
Registered: July 2009
Senior Member
Le 30/03/2011 09:36, shawn a écrit :
> A tree context menu has a second level menu
> And I tried this way
>
> tree.expandNode().getNode().contextMenu().click().menu().cli ck();
>
> this can find the menu
> but just for the first time,if I try to visit the menu for second time
> I got a "the widget was disposed" exception :(
> Could someone give me a help ?
>
>

Hi,

I have some code which works pretty well for problem of menu with sub-menus:

https://bugs.eclipse.org/bugs/show_bug.cgi?id=338555

HTH

Regards,

Mariot
--
Mariot Chauvin @ Obeo

Blog : http://mariot-thoughts.blogspot.com
Twitter :http://twitter.com/mchv
Professional support : http://obeo.fr/pages/maintenance-and-support/
Re: second level context menu [message #665055 is a reply to message #664814] Wed, 13 April 2011 07:10 Go to previous messageGo to next message
shawn  is currently offline shawn Friend
Messages: 9
Registered: February 2011
Junior Member
Hi, there Stefan Schaefer

thanks for your reply
but my problem is not disabled to find the menu
whatever which way, I can find the sub-menu
but just for the first time visit
well, the second visit will throw exception

org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundExcep tion: The widget {(of type 'MenuItem' and with mnemonic 'Column Analysis')} was disposed.
at org.eclipse.swtbot.swt.finder.widgets.AbstractSWTBot.<init>(AbstractSWTBot.java:106)
at org.eclipse.swtbot.swt.finder.widgets.SWTBotMenu.<init>(SWTBotMenu.java:42)
...
Re: second level context menu [message #665058 is a reply to message #664832] Wed, 13 April 2011 07:21 Go to previous messageGo to next message
shawn  is currently offline shawn Friend
Messages: 9
Registered: February 2011
Junior Member
Hi, Mariot Chauvin

I don't know how to use it, could you tell me what to do ?
I just imported the three classes
and seems there is no
"test.utils.menu.SWTBotContextMenu"
Re: second level context menu [message #665082 is a reply to message #665058] Wed, 13 April 2011 08:21 Go to previous messageGo to next message
Mariot Chauvin is currently offline Mariot ChauvinFriend
Messages: 174
Registered: July 2009
Senior Member
Le 13/04/2011 09:21, shawn a écrit :
> Hi, Mariot Chauvin
>
> I don't know how to use it, could you tell me what to do ?
> I just imported the three classes
> and seems there is no "test.utils.menu.SWTBotContextMenu"

SWTBotContextMenu is the third attachement of this bug.

to use it :

SWTBotTreeItem item = tree.expandNode("The label of the tree item on
which you want to right-click");

SWTBotUtils.clickContextMenu(treeItem, "The label of the menu item you
to click");

--
Mariot Chauvin @ Obeo

Blog : http://mariot-thoughts.blogspot.com
Twitter :http://twitter.com/mchv
Professional support : http://obeo.fr/pages/maintenance-and-support/
Re: second level context menu [message #665953 is a reply to message #665082] Mon, 18 April 2011 10:12 Go to previous message
shawn  is currently offline shawn Friend
Messages: 9
Registered: February 2011
Junior Member
Hi,
thanks Mariot Chauvin
tried with your help
and it works well now Surprised
Previous Topic:SwtBotTree's getNode/getAllItems problem
Next Topic:Using JAWS with Table widget
Goto Forum:
  


Current Time: Fri Apr 19 01:25:22 GMT 2024

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

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

Back to the top