Skip to main content


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 06:32 Go to next message
Alok Dwivedi is currently offline Alok DwivediFriend
Messages: 16
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.
  • Attachment: ExportImg.bmp
    (Size: 32.40KB, Downloaded 356 times)
Re: How to click menu items in SWTBOT [message #1090060 is a reply to message #1081372] Mon, 19 August 2013 16:57 Go to previous messageGo to next message
Mickael Istria is currently offline Mickael IstriaFriend
Messages: 865
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 11:54 Go to previous messageGo to next message
Alok Dwivedi is currently offline Alok DwivediFriend
Messages: 16
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 11:48 Go to previous message
Martin Schemel is currently offline Martin SchemelFriend
Messages: 6
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 Apr 19 20:00:24 GMT 2024

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

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

Back to the top