Skip to main content



      Home
Home » Eclipse Projects » SWTBot » How to click on toolbar dropdown menu item using SWTBOT
How to click on toolbar dropdown menu item using SWTBOT [message #1033456] Thu, 04 April 2013 04:42 Go to next message
Eclipse UserFriend
I am trying to automate the functional testcase of RCP application which requirs to click on menu item from the toolbar dropdown menu. I tried below snippet but it didn't worked, it just clicked on the dropdown menu but menuItems are not getting displayed. Same things works correctly when exeuted manually.


SWTBotToolbarDropDownButton myDropdown = getBot().toolbarDropDownButtonWithTooltip( "My Dropdown" );
SWTBotMenu showMenuItem = myDropdown.menuItem( "Show" );
showMenuItem.click();


This is how the dropdown menu in view toolbar
index.php/fa/14232/0/

and menu items in this menu are
index.php/fa/14233/0/

But when executing the SWTBOT testcase to click 'Show' menu item using above code I am getting the dropdown menu as
index.php/fa/14238/0/

Can some one suggest what might be wrong in above code or is there other way to do this ?


Thanks
Amruta
Re: How to click on toolbar dropdown menu item using SWTBOT [message #1037071 is a reply to message #1033456] Tue, 09 April 2013 02:27 Go to previous messageGo to next message
Eclipse UserFriend
On 04/05/2013 09:19 PM, Amruta L wrote:
> I am trying to automate the functional testcase of RCP application which requirs to click on menu item from the toolbar dropdown menu. I tried below snippet but it didn't worked, it just clicked on the dropdown menu but menuItems are not getting displayed. Same things works correctly when exeuted manually.

Is you application based on Eclipse 4.x ? I think you are hitting this
bug: https://bugs.eclipse.org/bugs/show_bug.cgi?id=388306
A change in implementation of menus in Eclipse 4 makes that the sequence
of events generated by SWTBot for some menus does not populate the menu.

I'd really glad if you could have a look to this bug, and maybe provide
a patch or any contribution that would help to get it fixed.

Cheers,
--
Mickael Istria
JBoss, by Red Hat
My blog: http://mickaelistria.wordpress.com
My Tweets: http://twitter.com/mickaelistria
Re: How to click on toolbar dropdown menu item using SWTBOT [message #1758589 is a reply to message #1037071] Thu, 30 March 2017 07:16 Go to previous messageGo to next message
Eclipse UserFriend
Is there a trick to close the shell that has been opened by the toolbar drop down button? I tried ESC but probably at the wrong location.
Re: How to click on toolbar dropdown menu item using SWTBOT [message #1758801 is a reply to message #1758589] Mon, 03 April 2017 06:42 Go to previous messageGo to next message
Eclipse UserFriend
Have you tried sending ESC on the toolbarbutton itself?
The following code works for me.
SWTBotToolbarDropDownButton b = bot.toolbarDropDownButtonWithTooltip("tooltip");
b.menuItem("menu").click();
b.pressShortcut(Keystrokes.ESC);
Re: How to click on toolbar dropdown menu item using SWTBOT [message #1758811 is a reply to message #1758801] Mon, 03 April 2017 08:37 Go to previous message
Eclipse UserFriend
Aparna Argade wrote on Mon, 03 April 2017 10:42
Have you tried sending ESC on the toolbarbutton itself?
The following code works for me.
SWTBotToolbarDropDownButton b = bot.toolbarDropDownButtonWithTooltip("tooltip");
b.menuItem("menu").click();
b.pressShortcut(Keystrokes.ESC);


That's what I am doing currently but the drop down does not close. It's still open and stays open (Oxygen using SWTBot snapshots). I've opened https://bugs.eclipse.org/514687 with a reproducible test for further investigation.

[Updated on: Tue, 04 April 2017 07:32] by Moderator

Previous Topic:Execute SWTBot in running IDE
Next Topic:SWTBot support for Nebula TableCombo?
Goto Forum:
  


Current Time: Tue May 20 03:16:46 EDT 2025

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

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

Back to the top