Runnable runnable = new Runnable() {
public void run() {
SWTWorkbenchBot bot=new SWTWorkbenchBot();
/*
*
*
*
*first swtbot
*/
bot.menu("File").menu("New").menu("Project...").click();
SWTBotShell shell = bot.shell("New Project");
shell.activate();
bot.tree().expandNode("Java").select("Java Project");
bot.button("Next >").click();
bot.textWithLabel("Project name:").setText("MyFirstProject");
bot.button("Finish").click();
/*
*
*
*
*second swtbot
*/
bot.menu("File").menu("New").menu("File").click();
SWTBotShell shell1 = bot.shell("New File");
shell1.activate();
bot.textWithLabel("File name:").setText("MyFile");
bot.button("Finish").click(); }
};
new Thread(runnable, "Executing thread...").start(); //$NON-NLS-1$
}[/B]
!ENTRY org.eclipse.ui 4 0 2011-01-04 14:30:01.245
!MESSAGE Unhandled event loop exception
!STACK 0
org.eclipse.swt.SWTException: Failed to execute runnable (org.eclipse.swt.SWTException: Widget is disposed)
at org.eclipse.swt.SWT.error(SWT.java:4083)
at org.eclipse.swt.SWT.error(SWT.java:3998)
at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:137)
at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4041)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3660)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2629)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2593)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2427)
at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:670)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:663)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:115)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:369)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:619)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:574)
at org.eclipse.equinox.launcher.Main.run(Main.java:1407)
at org.eclipse.equinox.launcher.Main.main(Main.java:1383)
Caused by: org.eclipse.swt.SWTException: Widget is disposed
at org.eclipse.swt.SWT.error(SWT.java:4083)
at org.eclipse.swt.SWT.error(SWT.java:3998)
at org.eclipse.swt.SWT.error(SWT.java:3969)
at org.eclipse.swt.widgets.Widget.error(Widget.java:468)
at org.eclipse.swt.widgets.Widget.checkWidget(Widget.java:340)
at org.eclipse.swt.widgets.Decorations.getMenuBar(Decorations.java:672)
at org.eclipse.swtbot.swt.finder.finders.MenuFinder$1.run(MenuFinder.java:106)
at org.eclipse.swtbot.swt.finder.finders.MenuFinder$1.run(MenuFinder.java:1)
at org.eclipse.swtbot.swt.finder.finders.UIThreadRunnable$2.doRun(UIThreadRunnable.java:140)
at org.eclipse.swtbot.swt.finder.finders.UIThreadRunnable$1.run(UIThreadRunnable.java:89)
at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:134)
... 23 more
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 com.sap.departmentdsl.providers.swtbot.MenuImpl.select(MenuImpl.java:26)
at com.sap.departmentdsl.core.impl.SelectMenuImpl.execute(SelectMenuImpl.java:166)
at com.sap.departmentdsl.core.impl.TestImpl.execute(TestImpl.java:313)
at com.sap.companydsl.ui.action.Executable$1.run(Executable.java:35)
at java.lang.Thread.run(Unknown Source)
Caused by: org.eclipse.swtbot.swt.finder.widgets.TimeoutException: Timeout after: 5000 ms.: Could not find a menu within the shell 'Shell with text {}' matching 'with mnemonic 'File''
at org.eclipse.swtbot.swt.finder.SWTBotFactory.waitUntil(SWTBotFactory.java:398)
at org.eclipse.swtbot.swt.finder.SWTBotFactory.waitUntil(SWTBotFactory.java:372)
at org.eclipse.swtbot.swt.finder.SWTBotFactory.waitUntil(SWTBotFactory.java:360)
at org.eclipse.swtbot.swt.finder.SWTBotFactory.waitUntilWidgetAppears(SWTBotFactory.java:346)
... 8 more
Exception in thread "Executing test..." 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.shells(SWTBotFactory.java:112)
at org.eclipse.swtbot.swt.finder.SWTBotFactory.shell(SWTBotFactory.java:102)
at org.eclipse.swtbot.swt.finder.SWTBotFactory.shell(SWTBotFactory.java:93)
at com.sap.departmentdsl.providers.swtbot.WizardImpl.open(WizardImpl.java:11)
at com.sap.departmentdsl.core.impl.WizardStepImpl.execute(WizardStepImpl.java:180)
at com.sap.departmentdsl.core.impl.TestImpl.execute(TestImpl.java:313)
at com.sap.companydsl.ui.action.Executable$1.run(Executable.java:35)
at java.lang.Thread.run(Unknown Source)
Caused by: org.eclipse.swtbot.swt.finder.widgets.TimeoutException: Timeout after: 5000 ms.: Could not find shell matching: with text 'New File'
at org.eclipse.swtbot.swt.finder.SWTBotFactory.waitUntil(SWTBotFactory.java:398)
at org.eclipse.swtbot.swt.finder.SWTBotFactory.waitUntil(SWTBotFactory.java:372)
at org.eclipse.swtbot.swt.finder.SWTBotFactory.waitUntil(SWTBotFactory.java:360)
at org.eclipse.swtbot.swt.finder.SWTBotFactory.waitUntilWidgetAppears(SWTBotFactory.java:346)
... 8 more