| Unable to change perspective using SWTbot and Juno [message #962777] |
Mon, 29 October 2012 06:19  |
Anitha Y Messages: 7 Registered: February 2010 |
Junior Member |
|
|
I have a huge set of test cases developed on Eclipse Indigo whose first constraint is to change the Eclipse perspective. Below is the code for the same.
SWTBotView view = bot.viewByTitle("Welcome");
if (view.isActive()) {
view.close();
}
// Change the perspective via the Open Perspective dialog
bot.menu("Window").menu("Open Perspective").menu("Other...").click();
SWTBotShell shell = bot.shell("Open Perspective");
shell.activate();
However the test case when running on Eclipse Juno (4.2) fails with the following error:
org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException: Could not find widget.
at org.eclipse.swtbot.swt.finder.SWTBotFactory.waitUntilWidgetAppears(SWTBotFactory.java:348)
at org.eclipse.swtbot.swt.finder.SWTBotFactory.menu(SWTBotFactory.java:257)
at org.eclipse.swtbot.swt.finder.SWTBotFactory.menu(SWTBotFactory.java:208)
at org.eclipse.swtbot.swt.finder.SWTBotFactory.menu(SWTBotFactory.java:198)
at ... 41 more
The exact line is while it is trying to access the menu. Do let me know if there is any change i need to make, to make the test case work for Juno.
Thanks in advance.
|
|
|
|
|
|
|
| Re: Unable to change perspective using SWTbot and Juno [message #987816 is a reply to message #981363] |
Wed, 28 November 2012 04:31   |
Anitha Y Messages: 7 Registered: February 2010 |
Junior Member |
|
|
> On 10/29/2012 11:19 AM, Anitha Mising name wrote:
>> The exact line is while it is trying to access the menu. Do let me know
>> if there is any change i need to make, to make the test case work for Juno.
> Which menu?
It's the basic Windows menu that is used to access perspectives as in the case of code below. This menu comes with Eclipse Juno 4.2.
bot.menu("Window")
> Is this menu actually here? Eclipse 4.2 has some refactoring in the
> Welcome menu IIRC, so maybe you're simply missing the plugin responsible
> of displaying it.
All the plugins are available.
> Do you use Linux? Do you have a working window manager on the DISPLAY
> you're using? I saw some issues like this one before because of usage of
> twm or other bad window managers...
No, i am Windows user. Also i found hitting this issue again when i tried to create some projects and build using 'Build All' option. I am unable to access the menu 'Project'.
bot.menu("Project").menu("Build All").click();
Even this throws the same WidgetNotFoundException.
[Updated on: Wed, 28 November 2012 04:33] Report message to a moderator
|
|
|
|
Powered by
FUDForum. Page generated in 0.02965 seconds