Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » SWTBot » Can't access some buttons in eclipse
Can't access some buttons in eclipse [message #720910] Wed, 31 August 2011 13:30 Go to next message
Mladen Mijatovic is currently offline Mladen MijatovicFriend
Messages: 7
Registered: August 2011
Junior Member
Hi,
While working with SWTBot tool on some eclipse GUI testing I have noticed a problem to access some of eclipse controls, like buttons on Package Explore view. The problem is access to a button "View Menu" (where I need to change presentation mode of Package Explorer to Hierarchical, tried somthing like:
SWTWorkbenchBot bot = new SWTWorkbenchBot();
SWTBotView packView = bot.viewByTitle("Package Explorer");
SWTBot packBot = packageExplorer.bot();

packBot.toolbarButtonWithTooltip("View Menu").click();
and
bot.toolbarButtonWithTooltip("View Menu").click();
or
bot.toolbarDropDownButtonWithTooltip("View Menu").click();
but neither one was successful. Also button "Link to Editor" is problem. I only manged to access button Collapse All and nothing else:
bot.toolbarButtonWithTooltip("Collapse All (Shift+Ctrl+Numpad_Divide)").click();


Also I had a problem to access context menu Source -> Clean Up by:
editor = bot.editorByTitle(CLASS_FILE_NAME).toTextEditor();
editor.contextMenu("&Source").menu("Clean &Up...").click();

There was widget not found exception. Does anybody have/had same problems and have some solution?

*Related to problem with buttons on Package Explorer: those options can be accessed through:

packageExplorer.menu("&Hierarchical").click();
or
packageExplorer.menu("&Flat").click();

And Clean Up.. option could be activated through:

editor.pressShortcut(SWT.SHIFT, SWT.ALT, 'S');
bot.menu("Clean &Up...").click();

when code for clean up is in active editor.

[Updated on: Thu, 17 November 2011 15:50]

Report message to a moderator

Re: Can't access some buttons in eclipse [message #757304 is a reply to message #720910] Thu, 17 November 2011 15:58 Go to previous message
Mladen Mijatovic is currently offline Mladen MijatovicFriend
Messages: 7
Registered: August 2011
Junior Member
Regarding the options of Package Explorer:
packageExplorer.menu("&Hierarchical").click();
or:
packageExplorer.menu("&Flat").click();

And also I found how to access code Clean Up... option:
editor.pressShortcut(SWT.SHIFT, SWT.ALT, 'S');
bot.menu("Clean &Up...").click();

when code that needs to be cleaned up is in active editor.
Previous Topic:Timed out waiting for Shell
Next Topic:How to use context menus that are created dynamically?
Goto Forum:
  


Current Time: Thu Apr 25 09:59:13 GMT 2024

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

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

Back to the top