Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » SWTBot » How to click menu items in SWTBOT
How to click menu items in SWTBOT [message #1081372] Wed, 07 August 2013 02:32 Go to next message
Alok Dwivedi is currently offline Alok Dwivedi
Messages: 5
Registered: June 2012
Junior Member
I have a editor toolbar where there is a SWTBotToolbarDropDownButton which further drops down to two Export Options.I want to click both these options one by one.For clicking the first option I had used the code:-

SWTBotToolbarDropDownButton button = dmdEditor.bot().toolbarDropDownButton(); assertNotNull(button);
button.click().menuItem("Export to MS Visio").click();
But this reports WidgetNotFoundException.
Please check this attached image and suggest me the code for clicking these dropdown options in SWTBOT.
Re: How to click menu items in SWTBOT [message #1090060 is a reply to message #1081372] Mon, 19 August 2013 12:57 Go to previous messageGo to next message
Mickael Istria is currently offline Mickael Istria
Messages: 741
Registered: July 2009
Location: Grenoble, France
Senior Member
On 08/07/2013 08:32 AM, Alok Dwivedi wrote:
> I have a editor toolbar where there is a SWTBotToolbarDropDownButton which further drops down to two Export Options.I want to click both these options one by one.For clicking the first option I had used the code:-
>
> SWTBotToolbarDropDownButton button = dmdEditor.bot().toolbarDropDownButton(); assertNotNull(button);
> button.click().menuItem("Export to MS Visio").click();
> But this reports WidgetNotFoundException.

When do you get this exception? When getting the button, or when getting
the menu?


--
Mickael Istria
JBoss, by Red Hat
My blog: http://mickaelistria.wordpress.com
My Tweets: http://twitter.com/mickaelistria
Re: How to click menu items in SWTBOT [message #1090610 is a reply to message #1090060] Tue, 20 August 2013 07:54 Go to previous messageGo to next message
Alok Dwivedi is currently offline Alok Dwivedi
Messages: 5
Registered: June 2012
Junior Member
The exception occurred while finding the menu item.
Re: How to click menu items in SWTBOT [message #1173254 is a reply to message #1090610] Wed, 06 November 2013 06:48 Go to previous message
Martin Schemel is currently offline Martin Schemel
Messages: 4
Registered: November 2013
Location: Berlin
Junior Member
This should work:
bot.toolbarDropDownButton().menuItem("Export to MS Visio").click();
bot.toolbarDropDownButton().menuItem("Export to Image").click();
Previous Topic:How to click a button until the condition is true.?
Next Topic:"Validation" and "Error Markers" behave strange when testing
Goto Forum:
  


Current Time: Fri Aug 22 11:47:14 EDT 2014

Powered by FUDForum. Page generated in 0.02108 seconds