Home » Eclipse Projects » SWTBot » Finding difficult to select an context menu
| |
Re: Finding difficult to select an context menu [message #38012 is a reply to message #37532] |
Sun, 31 May 2009 21:12 |
Stefan Seelmann Messages: 11 Registered: July 2009 |
Junior Member |
|
|
I have a slight different problem: My context menu is created
programmatically using IMenuListener.menuAboutToShow( IMenuManager )
method. I get the "disposed" exception when I try to access the menu at
the second level.
I created a small helper that works for me, see below. The idea is to
click the menu item _before_ sending the SWT.Hide event for the context
menu. Additionally the whole menu path is expected.
Maybe the others could test this snippet and report if it helps? If so I
would suggest to extend the existing API. The usage is
ContextMenuHelper.clickContextMenu(treeNode, "Import", "LDIF");
Kind Regards,
Stefan
------------------------------------------------------------ -------
import static
org.eclipse.swtbot.swt.finder.matchers.WidgetMatcherFactory. withMnemonic;
import static org.hamcrest.Matchers.allOf;
import static org.hamcrest.Matchers.instanceOf;
import java.util.Arrays;
import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Event;
import org.eclipse.swt.widgets.Menu;
import org.eclipse.swt.widgets.MenuItem;
import org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundExcep tion;
import org.eclipse.swtbot.swt.finder.finders.UIThreadRunnable;
import org.eclipse.swtbot.swt.finder.results.VoidResult;
import org.eclipse.swtbot.swt.finder.results.WidgetResult;
import org.eclipse.swtbot.swt.finder.widgets.AbstractSWTBot;
import org.hamcrest.Matcher;
public class ContextMenuHelper {
/**
* Clicks the context menu matching the text.
*
* @param text
* the text on the context menu.
* @throws WidgetNotFoundException
* if the widget is not found.
*/
public static void clickContextMenu(final AbstractSWTBot<?> bot,
final String... texts) {
// show
final MenuItem menuItem = UIThreadRunnable
.syncExec(new WidgetResult<MenuItem>() {
public MenuItem run() {
MenuItem menuItem = null;
Control control = (Control) bot.widget;
Menu menu = control.getMenu();
for (String text : texts) {
Matcher<?> matcher = allOf(instanceOf(MenuItem.class),
withMnemonic(text));
menuItem = show(menu, matcher);
if (menuItem != null) {
menu = menuItem.getMenu();
} else {
hide(menu);
break;
}
}
return menuItem;
}
});
if (menuItem == null) {
throw new WidgetNotFoundException("Could not find menu: "
+ Arrays.asList(texts));
}
// click
click(menuItem);
// hide
UIThreadRunnable.syncExec(new VoidResult() {
public void run() {
hide(menuItem.getParent());
}
});
}
private static MenuItem show(final Menu menu, final Matcher<?> matcher) {
if (menu != null) {
menu.notifyListeners(SWT.Show, new Event());
MenuItem[] items = menu.getItems();
for (final MenuItem menuItem : items) {
if (matcher.matches(menuItem)) {
return menuItem;
}
}
menu.notifyListeners(SWT.Hide, new Event());
}
return null;
}
private static void click(final MenuItem menuItem) {
final Event event = new Event();
event.time = (int) System.currentTimeMillis();
event.widget = menuItem;
event.display = menuItem.getDisplay();
event.type = SWT.Selection;
UIThreadRunnable.asyncExec(menuItem.getDisplay(), new VoidResult() {
public void run() {
menuItem.notifyListeners(SWT.Selection, event);
}
});
}
private static void hide(final Menu menu) {
menu.notifyListeners(SWT.Hide, new Event());
if (menu.getParentMenu() != null) {
hide(menu.getParentMenu());
}
}
}
|
|
|
Re: Finding difficult to select an context menu [message #479900 is a reply to message #38012] |
Thu, 13 August 2009 00:11 |
Eclipse User |
|
|
|
Originally posted by: jconlon.apache.org
Hi Stefan,
I found your helper in the newsgroup. It's worked well for me.
Added a few log statements to help troubleshoot those pesky 'spaces in
the wrong places' bugs that can really be a pain to find.
See below...
thanks for the suggestion,
John
Stefan Seelmann wrote:
> I have a slight different problem: My context menu is created
> programmatically using IMenuListener.menuAboutToShow( IMenuManager )
> method. I get the "disposed" exception when I try to access the menu at
> the second level.
>
> I created a small helper that works for me, see below. The idea is to
> click the menu item _before_ sending the SWT.Hide event for the context
> menu. Additionally the whole menu path is expected.
>
> Maybe the others could test this snippet and report if it helps? If so I
> would suggest to extend the existing API. The usage is
> ContextMenuHelper.clickContextMenu(treeNode, "Import", "LDIF");
>
> Kind Regards,
> Stefan
>
>
> ------------------------------------------------------------ -------
> import static
> org.eclipse.swtbot.swt.finder.matchers.WidgetMatcherFactory. withMnemonic;
> import static org.hamcrest.Matchers.allOf;
> import static org.hamcrest.Matchers.instanceOf;
>
> import java.util.Arrays;
>
> import org.eclipse.swt.SWT;
> import org.eclipse.swt.widgets.Control;
> import org.eclipse.swt.widgets.Event;
> import org.eclipse.swt.widgets.Menu;
> import org.eclipse.swt.widgets.MenuItem;
> import org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundExcep tion;
> import org.eclipse.swtbot.swt.finder.finders.UIThreadRunnable;
> import org.eclipse.swtbot.swt.finder.results.VoidResult;
> import org.eclipse.swtbot.swt.finder.results.WidgetResult;
> import org.eclipse.swtbot.swt.finder.widgets.AbstractSWTBot;
> import org.hamcrest.Matcher;
>
> public class ContextMenuHelper {
>
private static Logger log = Logger.getLogger(ContextMenuHelper.class);
> /**
> * Clicks the context menu matching the text.
> *
> * @param text
> * the text on the context menu.
> * @throws WidgetNotFoundException
> * if the widget is not found.
> */
> public static void clickContextMenu(final AbstractSWTBot<?> bot,
> final String... texts) {
>
log.debug("Searching for "+Arrays.asList(texts) );
> // show
> final MenuItem menuItem = UIThreadRunnable
> .syncExec(new WidgetResult<MenuItem>() {
> public MenuItem run() {
> MenuItem menuItem = null;
> Control control = (Control) bot.widget;
> Menu menu = control.getMenu();
> for (String text : texts) {
log.debug("Matching:<"+text+'>');
> Matcher<?> matcher = allOf(instanceOf(MenuItem.class),
> withMnemonic(text));
> menuItem = show(menu, matcher);
> if (menuItem != null) {
> menu = menuItem.getMenu();
> } else {
> hide(menu);
> break;
> }
> }
>
> return menuItem;
> }
> });
> if (menuItem == null) {
> throw new WidgetNotFoundException("Could not find menu: "
> + Arrays.asList(texts));
> }
>
> // click
> click(menuItem);
>
> // hide
> UIThreadRunnable.syncExec(new VoidResult() {
> public void run() {
> hide(menuItem.getParent());
> }
> });
> }
>
> private static MenuItem show(final Menu menu, final Matcher<?> matcher) {
> if (menu != null) {
> menu.notifyListeners(SWT.Show, new Event());
> MenuItem[] items = menu.getItems();
> for (final MenuItem menuItem : items) {
> if (matcher.matches(menuItem)) {
log.debug("Found menuItem match: <"+menuItem.getText()+'>');
> return menuItem;
> }
else{
log.debug("Rejecting menuItem match:<"+
menuItem.getText()+'>');
}
> }
> menu.notifyListeners(SWT.Hide, new Event());
> }
> return null;
> }
>
> private static void click(final MenuItem menuItem) {
> final Event event = new Event();
> event.time = (int) System.currentTimeMillis();
> event.widget = menuItem;
> event.display = menuItem.getDisplay();
> event.type = SWT.Selection;
>
> UIThreadRunnable.asyncExec(menuItem.getDisplay(), new VoidResult() {
> public void run() {
> menuItem.notifyListeners(SWT.Selection, event);
> }
> });
> }
>
> private static void hide(final Menu menu) {
> menu.notifyListeners(SWT.Hide, new Event());
> if (menu.getParentMenu() != null) {
> hide(menu.getParentMenu());
> }
> }
> }
|
|
| | |
Re: Finding difficult to select an context menu [message #489602 is a reply to message #488452] |
Mon, 05 October 2009 09:30 |
Eclipse User |
|
|
|
Pascal Gelinas schrieb:
> Michelle Davidson wrote:
>> Hello
>> I want to use the ContextMenuhelper for click a contextmenu for a
>> treeItem.
>>
>> My test looks follow.
>>
>> SWTBotTree tree = bot.treeWithId("folderTree");
>> SWTBotTreeItem treeItem = tree.getTreeItem("TestFolder
>> 01").select();
>> ContextMenuHelper.clickContextMenu(treeItem, "Properties");
>>
>> But when I run the test I get the folow Exception.
>>
>> org.eclipse.swt.SWTException: Failed to execute runnable
>> (java.lang.ClassCastException: org.eclipse.swt.widgets.TreeItem cannot
>> be cast to org.eclipse.swt.widgets.Control
>>
>> What must I change that I can click the contextMenu of a treeitem?
>
> The ContextMenuHelper works only for Control subclasses. TreeItem is not
> a subclass of Control and thus cannot work. It would suggest passing the
> tree instead and see what happens (keep the rest of the code as is):
> SWTBotTree tree = bot.treeWithId("folderTree");
> SWTBotTreeItem treeItem = tree.getTreeItem("TestFolder
> 01").select();
> ContextMenuHelper.clickContextMenu(tree, "Properties");
>
> On a side-note, the signature of that method should be changed to:
> public static void clickContextMenu(final AbstractSWTBot<? extends
> Control, final String...).
> It would also render the cast in "Control control = (Control)
> bot.widget;" obsolete.
>
> Hope this help.
Seems to work only for the first level entries.
How can i click for example on the entry "New" -> "Folder" ?
|
|
| |
Re: Finding difficult to select an context menu [message #489843 is a reply to message #489757] |
Tue, 06 October 2009 08:30 |
Eclipse User |
|
|
|
Pascal Gelinas schrieb:
> Aleksey Shumilin wrote:
>> Seems to work only for the first level entries.
>> How can i click for example on the entry "New" -> "Folder" ?
>
> From my understanding of the code, this should work (I have not tested
> this myself by it seems correct). To click on "New" -> "Folder", do the
> following:
> ContextMenuHelper.clickContextMenu(bot, "New, "Folder");
oh yes, it works, thank you Pascal !
|
|
|
Re: Finding difficult to select an context menu [message #491152 is a reply to message #38012] |
Tue, 13 October 2009 13:30 |
Michelle Davidson Messages: 41 Registered: August 2009 |
Member |
|
|
Stefan Seelmann wrote on Sun, 31 May 2009 17:12 | I have a slight different problem: My context menu is created
programmatically using IMenuListener.menuAboutToShow( IMenuManager )
method. I get the "disposed" exception when I try to access the menu at
the second level.
I created a small helper that works for me, see below. The idea is to
click the menu item _before_ sending the SWT.Hide event for the context
menu. Additionally the whole menu path is expected.
Maybe the others could test this snippet and report if it helps? If so I
would suggest to extend the existing API. The usage is
ContextMenuHelper.clickContextMenu(treeNode, "Import", "LDIF");
Kind Regards,
Stefan
------------------------------------------------------------ -------
import static
org.eclipse.swtbot.swt.finder.matchers.WidgetMatcherFactory. withMnemonic;
import static org.hamcrest.Matchers.allOf;
import static org.hamcrest.Matchers.instanceOf;
import java.util.Arrays;
import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Event;
import org.eclipse.swt.widgets.Menu;
import org.eclipse.swt.widgets.MenuItem;
import org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundExcep tion;
import org.eclipse.swtbot.swt.finder.finders.UIThreadRunnable;
import org.eclipse.swtbot.swt.finder.results.VoidResult;
import org.eclipse.swtbot.swt.finder.results.WidgetResult;
import org.eclipse.swtbot.swt.finder.widgets.AbstractSWTBot;
import org.hamcrest.Matcher;
public class ContextMenuHelper {
/**
* Clicks the context menu matching the text.
*
* @param text
* the text on the context menu.
* @throws WidgetNotFoundException
* if the widget is not found.
*/
public static void clickContextMenu(final AbstractSWTBot<?> bot,
final String... texts) {
// show
final MenuItem menuItem = UIThreadRunnable
.syncExec(new WidgetResult<MenuItem>() {
public MenuItem run() {
MenuItem menuItem = null;
Control control = (Control) bot.widget;
Menu menu = control.getMenu();
for (String text : texts) {
Matcher<?> matcher = allOf(instanceOf(MenuItem.class),
withMnemonic(text));
menuItem = show(menu, matcher);
if (menuItem != null) {
menu = menuItem.getMenu();
} else {
hide(menu);
break;
}
}
return menuItem;
}
});
if (menuItem == null) {
throw new WidgetNotFoundException("Could not find menu: "
+ Arrays.asList(texts));
}
// click
click(menuItem);
// hide
UIThreadRunnable.syncExec(new VoidResult() {
public void run() {
hide(menuItem.getParent());
}
});
}
private static MenuItem show(final Menu menu, final Matcher<?> matcher) {
if (menu != null) {
menu.notifyListeners(SWT.Show, new Event());
MenuItem[] items = menu.getItems();
for (final MenuItem menuItem : items) {
if (matcher.matches(menuItem)) {
return menuItem;
}
}
menu.notifyListeners(SWT.Hide, new Event());
}
return null;
}
private static void click(final MenuItem menuItem) {
final Event event = new Event();
event.time = (int) System.currentTimeMillis();
event.widget = menuItem;
event.display = menuItem.getDisplay();
event.type = SWT.Selection;
UIThreadRunnable.asyncExec(menuItem.getDisplay(), new VoidResult() {
public void run() {
menuItem.notifyListeners(SWT.Selection, event);
}
});
}
private static void hide(final Menu menu) {
menu.notifyListeners(SWT.Hide, new Event());
if (menu.getParentMenu() != null) {
hide(menu.getParentMenu());
}
}
}
|
Hello Stefan.
Have you already suggest to extend the API, because I think your ContextmenHelper works fine. And so could everybody use it, without looking for this thread.
|
|
| | |
Re: Finding difficult to select an context menu [message #664833 is a reply to message #36892] |
Tue, 12 April 2011 08:56 |
Stefan Schaefer Messages: 2 Registered: April 2011 |
Junior Member |
|
|
Hi all,
hopefully no one is offended by me pulling up this old thread.
But I find the proposed ContextMenuHelper of Stefan Seelmann very useful. Thus I'd once again vote for taking this into SWTBot by default
There's only one small enhancement I needed to add to make this work for me: The MenuDetect-Event. So, before calling the menu of the control, I fire the mentioned event, so that the listeners may prepare for (or prevent) the opening of the menu.
Below is the complete code with my changes
import static org.eclipse.swtbot.swt.finder.matchers.WidgetMatcherFactory.withMnemonic;
import static org.hamcrest.Matchers.allOf;
import static org.hamcrest.Matchers.instanceOf;
import java.util.Arrays;
import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Event;
import org.eclipse.swt.widgets.Menu;
import org.eclipse.swt.widgets.MenuItem;
import org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException;
import org.eclipse.swtbot.swt.finder.finders.UIThreadRunnable;
import org.eclipse.swtbot.swt.finder.results.VoidResult;
import org.eclipse.swtbot.swt.finder.results.WidgetResult;
import org.eclipse.swtbot.swt.finder.widgets.AbstractSWTBot;
import org.hamcrest.Matcher;
/**
* This helper is a workaround for a bug in SWTBot,
* where the bot can't find a dynamically created context menu
* @author Stefan Seelmann (initial)
* @author Stefan Schaefer (extension)
*/
public class ContextMenuHelper {
/**
* Clicks the context menu matching the text.
*
* @param text
* the text on the context menu.
* @throws WidgetNotFoundException
* if the widget is not found.
*/
public static void clickContextMenu(final AbstractSWTBot<?> bot,
final String... texts) {
// show
final MenuItem menuItem = UIThreadRunnable
.syncExec(new WidgetResult<MenuItem>() {
public MenuItem run() {
MenuItem menuItem = null;
Control control = (Control) bot.widget;
//MenuDetectEvent added by Stefan Schaefer
Event event = new Event();
control.notifyListeners(SWT.MenuDetect, event);
if (!event.doit) {
return null;
}
Menu menu = control.getMenu();
for (String text : texts) {
@SuppressWarnings("unchecked")
Matcher<?> matcher = allOf(
instanceOf(MenuItem.class),
withMnemonic(text));
menuItem = show(menu, matcher);
if (menuItem != null) {
menu = menuItem.getMenu();
} else {
hide(menu);
break;
}
}
return menuItem;
}
});
if (menuItem == null) {
throw new WidgetNotFoundException("Could not find menu: "
+ Arrays.asList(texts));
}
// click
click(menuItem);
// hide
UIThreadRunnable.syncExec(new VoidResult() {
public void run() {
hide(menuItem.getParent());
}
});
}
private static MenuItem show(final Menu menu, final Matcher<?> matcher) {
if (menu != null) {
menu.notifyListeners(SWT.Show, new Event());
MenuItem[] items = menu.getItems();
for (final MenuItem menuItem : items) {
if (matcher.matches(menuItem)) {
return menuItem;
}
}
menu.notifyListeners(SWT.Hide, new Event());
}
return null;
}
private static void click(final MenuItem menuItem) {
final Event event = new Event();
event.time = (int) System.currentTimeMillis();
event.widget = menuItem;
event.display = menuItem.getDisplay();
event.type = SWT.Selection;
UIThreadRunnable.asyncExec(menuItem.getDisplay(), new VoidResult() {
public void run() {
menuItem.notifyListeners(SWT.Selection, event);
}
});
}
private static void hide(final Menu menu) {
menu.notifyListeners(SWT.Hide, new Event());
if (menu.getParentMenu() != null) {
hide(menu.getParentMenu());
}
}
}
|
|
| | | | |
Re: Finding difficult to select an context menu [message #994818 is a reply to message #994567] |
Fri, 28 December 2012 11:00 |
|
Hi
if you see https://bugs.eclipse.org/bugs/show_bug.cgi?id=384621 and use
the update site you find there, there should be no need to use the
ContextMenuHelper manually, since the SWTBotTreeItem.contextMenu should
be fixed (it uses internally the ContextMenuHelper)...
are you sure that "Run As","Run on Server" are exactly the labels of the
context menu? No "..." anywhere?
hope this helps
Lorenzo
On 12/27/2012 06:47 PM, Shabari shetty wrote:
> Hi,
>
> I am trying to click the submenu of a context menu on a tree item using ContextMenuHelper. My code looks like below
>
> SWTBotView view = bot.viewByTitle("Package Explorer");
> view.setFocus();
> SWTBotTree tree = view.bot().tree();
> // tree.getAllItems()
> SWTBotTreeItem treeItem = view.bot().tree()
> .getTreeItem("JavaPrj");
> treeItem.expand();
> bot.sleep(1000);
> SWTBotTreeItem[] items = treeItem.getItems();
> SWTBotTreeItem srcNode2 = null;
> SWTBotTreeItem javaClass = null;
> for(SWTBotTreeItem prjNode : items){
> if(prjNode.getText().equals("src")){
> prjNode.expand();
> SWTBotTreeItem [] srcNodes = prjNode.getItems();
>
> for(SWTBotTreeItem srcNode : srcNodes){
> srcNode.expand();
> javaClass = srcNode.getItems()[0];
>
> }
> }
> }
> javaClass.select();
> ContextMenuHelper.clickContextMenu(tree, "Run As","Run on Server");
>
> Here I am trying to select a tree item node which is a java class then say Run As->Run On Server. I get the excatpion widget not found (Run As, Run on Server) exception. Please note that my context menu is not populated programmatic-ally. I am also attaching the class ContextMenuHelper.java which I am using. Can someone please tell m,e what do I need to change to make this working
>
> Thanks in advance
> Shabari
>
--
Lorenzo Bettini, PhD in Computer Science, DI, Univ. Torino
ICQ# lbetto, 16080134 (GNU/Linux User # 158233)
HOME: http://www.lorenzobettini.it MUSIC: http://www.purplesucker.com
http://www.myspace.com/supertrouperabba
BLOGS: http://tronprog.blogspot.com http://longlivemusic.blogspot.com
http://www.gnu.org/software/src-highlite
http://www.gnu.org/software/gengetopt
http://www.gnu.org/software/gengen http://doublecpp.sourceforge.net
HOME: http://www.lorenzobettini.it
TDD Book: https://leanpub.com/tdd-buildautomation-ci
Xtext Book: https://www.packtpub.com/application-development/implementing-domain-specific-languages-xtext-and-xtend-second-edition
|
|
| |
Re: Finding difficult to select an context menu [message #1008720 is a reply to message #1008712] |
Wed, 13 February 2013 17:40 |
|
Seems like this may still be an issue for accessing editor context menus. I installed 2.1.0.201302091231, and got the following stack trace:
org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException: The widget {(of type 'MenuItem' and with mnemonic 'Resolve icon')} was disposed.
at org.eclipse.swtbot.swt.finder.widgets.AbstractSWTBot.<init>(AbstractSWTBot.java:106)
at org.eclipse.swtbot.swt.finder.widgets.SWTBotMenu.<init>(SWTBotMenu.java:42)
at org.eclipse.swtbot.swt.finder.widgets.AbstractSWTBot.contextMenu(AbstractSWTBot.java:460)
at org.eclipse.swtbot.swt.finder.widgets.AbstractSWTBot.contextMenu(AbstractSWTBot.java:430)
at org.eclipse.swtbot.eclipse.finder.widgets.SWTBotEclipseEditor.contextMenu(SWTBotEclipseEditor.java:269)
at com.exoanalytic.seas.ide.editor.ResolveIconHandlerTest.testResolveIcon(ResolveIconHandlerTest.java:22)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
at org.junit.runners.BlockJUnit4ClassRunner.runNotIgnored(BlockJUnit4ClassRunner.java:79)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:71)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:49)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
at org.eclipse.swtbot.eclipse.core.RemotePluginTestRunner.main(RemotePluginTestRunner.java:64)
at org.eclipse.swtbot.eclipse.core.UITestApplication.runTests(UITestApplication.java:117)
at org.eclipse.ui.internal.testing.WorkbenchTestable$1.run(WorkbenchTestable.java:71)
at java.lang.Thread.run(Thread.java:680)
From the following code:
SWTBotEclipseEditor editor = bot.activeEditor().toTextEditor();
editor.navigateTo(9, 3);
editor.contextMenu("Resolve icon").click();
SWTBotShell dialog = bot.activeShell();
|
|
| | |
Re: Finding difficult to select an context menu [message #1021739 is a reply to message #1021727] |
Wed, 20 March 2013 15:52 |
|
Thanks for responding Mickael. Yes I have <useUIThread> set to false. And I am running on windows locally but will build on Hudson eventually with xvnc running. In my pom I have a dependency on 'org.hamcrest' identified. I don't know if I need that or not but I don't know of any implicit dependencies.
Craig
|
|
| | | | |
Goto Forum:
Current Time: Fri Nov 08 22:37:58 GMT 2024
Powered by FUDForum. Page generated in 0.05503 seconds
|