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 09:30 Go to next message
Mladen Mijatovic is currently offline Mladen Mijatovic
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 10: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 10:58 Go to previous message
Mladen Mijatovic is currently offline Mladen Mijatovic
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: Sun Apr 20 06:52:33 EDT 2014

Powered by FUDForum. Page generated in 0.02473 seconds