I have an RCP app for which I am using SWTBot to implement UI tests.
I have a particular use case that I can't seem to be able to generate tests for.
I have a view that contains several items in its toolbar. One of them reacts to a mouse hover event only and I haven't found a way yet to trigger a mouse hover event in SWTBot for this particular toolbar item.
Any ideas how to do that ?
Here is my attempt so far that results in the below exception:
final IToolBarManager items = mySwtBotView.getViewReference().getView(false).getViewSite().getActionBars().getToolBarManager();
for (final IContributionItem item : items.getItems()) {
final Widget widget = (Widget) item;
widget.notifyListeners(SWT.MouseHover, null);
}
java.lang.ClassCastException: class MyToolbarAction cannot be cast to class org.eclipse.swt.widgets.Widget (class MyToolbarAction is in unnamed module of loader org.eclipse.osgi.internal.loader.EquinoxClassLoader @68aa43bb;
Thanks in advance
[Updated on: Thu, 28 July 2022 22:42]
Report message to a moderator