Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » SWTBot » Context Menu on CDT expressions view ( Luna and SWTBot2.2.1)(Attempt to access expressions view context menu through SWTBotleads to exception)
Context Menu on CDT expressions view ( Luna and SWTBot2.2.1) [message #1433943] Mon, 29 September 2014 12:53 Go to next message
Shaiju P is currently offline Shaiju PFriend
Messages: 2
Registered: September 2014
Junior Member
I am using LUNA SR1 (4.4.1) and CDT head code base with SWTBOT 2.2.1
Attempting a simple test to click a context menu item on a expression that is available on debugger expression view is leading to an exception from the platform code. Exception stack trace is as follows .


!ENTRY org.eclipse.ui 4 0 2014-09-29 18:13:33.196
!MESSAGE Unhandled event loop exception
!STACK 0
org.eclipse.swt.SWTException: Failed to execute runnable (org.eclipse.core.runtime.AssertionFailedException: null argument:Action must not be null)
at org.eclipse.swt.SWT.error(SWT.java:4441)
at org.eclipse.swt.SWT.error(SWT.java:4356)
at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:139)
at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4147)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3764)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1151)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1032)
at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:148)
at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:636)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:579)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150)
at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:135)
at org.eclipse.swtbot.eclipse.core.UITestApplication.start(UITestApplication.java:54)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:380)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603)
at org.eclipse.equinox.launcher.Main.run(Main.java:1465)
at org.eclipse.equinox.launcher.Main.main(Main.java:1438)
Caused by: org.eclipse.core.runtime.AssertionFailedException: null argument:Action must not be null
at org.eclipse.core.runtime.Assert.isNotNull(Assert.java:85)
at org.eclipse.jface.action.ContributionManager.add(ContributionManager.java:76)
at org.eclipse.debug.internal.ui.views.expression.ExpressionView.fillContextMenu(ExpressionView.java:89)
at org.eclipse.debug.ui.AbstractDebugView$2.menuAboutToShow(AbstractDebugView.java:556)
at org.eclipse.jface.action.MenuManager.fireAboutToShow(MenuManager.java:352)
at org.eclipse.jface.action.MenuManager.handleAboutToShow(MenuManager.java:492)
at org.eclipse.jface.action.MenuManager.access$1(MenuManager.java:487)
at org.eclipse.jface.action.MenuManager$2.menuShown(MenuManager.java:519)
at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:255)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4353)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1061)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1085)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1070)
at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:782)
at org.eclipse.swtbot.swt.finder.finders.MenuFinder.findMenusInternal(MenuFinder.java:152)
at org.eclipse.swtbot.swt.finder.finders.MenuFinder.access$0(MenuFinder.java:149)
at org.eclipse.swtbot.swt.finder.finders.MenuFinder$2.run(MenuFinder.java:124)
at org.eclipse.swtbot.swt.finder.finders.MenuFinder$2.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:136)
... 25 more


This exception says that menu.add(getAction(FIND_ACTION));

is causing the trouble . Method getAction() is unable to get "Find" action object. But if I am doing it manually this exception is not coming. I debugged that part of code and when doing manually method returns a valid object and when running through SWTbot method returns null.

My test code is which gets into trouble is show below

private void disableExpression()
{
SWTWorkbenchBot vbot= new SWTWorkbenchBot();
SWTBotView vv=vbot.viewByTitle("Expressions");
vbot.sleep(1000);
SWTBotTree expressionTree = vv.bot().tree();

//expressionTree.
expressionTree.select("x_mfa"); // select the the expression that is existing
vbot.sleep(100);
expressionTree.contextMenu("Disable");
}

Did any one try context menu on CDT views or debug views like Variables , Expressions etc. on LUNA ? Any idea while running with SWTBot this happens but not when manually accessing the context menu?

Any help is much appreciated
Thanks
Shaiju.P
Re: Context Menu on CDT expressions view ( Luna and SWTBot2.2.1) [message #1435400 is a reply to message #1433943] Wed, 01 October 2014 12:45 Go to previous messageGo to next message
pawan garia is currently offline pawan gariaFriend
Messages: 39
Registered: February 2013
Member
Can you try the following

private void disableExpression()
{
SWTWorkbenchBot vbot= new SWTWorkbenchBot();
SWTBotView vv=vbot.viewByTitle("Expressions");
vbot.sleep(1000);
SWTBotTree expressionTree = vv.bot().tree();

//expressionTree.
expressionTree.select("x_mfa").contextMenu("Disable");
}
Re: Context Menu on CDT expressions view ( Luna and SWTBot2.2.1) [message #1438684 is a reply to message #1435400] Mon, 06 October 2014 11:05 Go to previous messageGo to next message
Shaiju P is currently offline Shaiju PFriend
Messages: 2
Registered: September 2014
Junior Member
This did not work , same problem occurs
Re: Context Menu on CDT expressions view ( Luna and SWTBot2.2.1) [message #1450714 is a reply to message #1438684] Wed, 22 October 2014 20:54 Go to previous message
Lisa Jett is currently offline Lisa JettFriend
Messages: 14
Registered: July 2009
Junior Member
I am experiencing this same issue. It appears to be a known bug:

https://bugs.eclipse.org/bugs/show_bug.cgi?id=363916

Previous Topic:SWTBot in Mars
Next Topic:Display not found in framework
Goto Forum:
  


Current Time: Thu Mar 28 16:14:08 GMT 2024

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

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

Back to the top