|
Re: SWTBotTreeItem's context menu click gives TimeoutException [message #1416222 is a reply to message #1416063] |
Thu, 04 September 2014 15:47   |
|
> org.eclipse.swtbot.swt.finder.widgets.TimeoutException: Timeout after:
> 5000 ms.: Could not find context menu with text 'Disable'
> 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)
This stack doesn't seem related to SWTBot. You should check what can be
a cause of this error.
But it might also be in bug in SWTBot not sending the right menu event...
--
Mickael Istria
My job: http://www.jboss.org/tools
My blog: http://mickaelistria.wordpress.com
My Tweets: http://twitter.com/mickaelistria
|
|
|
|
|
|
|
|
|
Re: SWTBotTreeItem's context menu click gives TimeoutException [message #1471762 is a reply to message #1429440] |
Thu, 13 November 2014 10:06  |
Aparna Argade Messages: 60 Registered: October 2010 |
Member |
|
|
It seems I found how to make it work!
Actually the problem was caused due to not finding entry in fActionMap upon FocusLost event, which gets called as a result of SWTBotTreeItem.notifySelect().
If I comment out the line which sends SWT.FocusOut event in SWTBotTreeItem.notifySelect() method, then context menu click happens without any problem. UI also gets updated, as expected.
After commenting out this line, FocusLost routine of VariablesView in eclipse is not called and hence the globalActions (e.g. 'find' action) is not removed. Therefore, fActionMap gets entry for 'find' action in fillContextMenu() method of VariablesView and the further code also executes well.
Is this solution okay? Will it have any side-effects?
Please share your thoughts.
I've one more question--
If I compare implementation of notifySelect() method of SWTBotTableItem and SWTBotTreeItem, I see that-
SWTBotTableItem sends only SWT.Selection and SWTBotTreeItem sends a series of SWT events like MouseEnter, MouseMove, Activate, FocusIn and so on.
Are all these events required?
If I comment-out all events and keep only SWT.Selection in SWTBotTreeItem.notifySelect(), then also context menu click happens okay.
Is SWT.Selection alone not sufficient?
I'm not able to figure out the need for each event here. It would be very helpful if somebody explains it.
Thanks..
Aparna
|
|
|
Powered by
FUDForum. Page generated in 0.03780 seconds