Hi Ketan,




      We are facing a problem in accessing the context menu and its sub menu
items in the Project Explorer view after selecting a project.

As an example . Right click on the Project(In Project Explorer view) -> Team
-> Share Project.



We tried with the following code :



SWTBotView packageExplorerView = *bot*.viewByTitle("Project Explorer");

packageExplorerView.setFocus();

SWTBotTree tree = *bot*.tree().select("Project123");

SWTBotMenu menu123 = tree.select("Project123").contextMenu("Team");

SWTBotMenu submenu123 = menu123.menu("Share Project...");

submenu123.click();





Error is :



org.eclipse.swtbot.swt.finder.widgets.TimeoutException: Timeout after: 5000
ms.: Could not find context menu with text: Team

                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.widgets.AbstractSWTBot.contextMenu(AbstractSWTBot.java:424)

                at
org.eclipse.swtbot.swt.finder.widgets.AbstractSWTBot.contextMenu(AbstractSWTBot.java:403)

                at
org.eclipsecon.swtbot.example.ShareProject2.canShareProject(ShareProject2.java:63)

                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.junit.internal.runners.TestMethodRunner.executeMethodBody(TestMethodRunner.java:99)

                at
org.junit.internal.runners.TestMethodRunner.runUnprotected(TestMethodRunner.java:81)

                at
org.junit.internal.runners.BeforeAndAfterRunner.runProtected(BeforeAndAfterRunner.java:34)

                at
org.junit.internal.runners.TestMethodRunner.runMethod(TestMethodRunner.java:75)

                at
org.junit.internal.runners.TestMethodRunner.run(TestMethodRunner.java:45)

                at
org.junit.internal.runners.TestClassMethodsRunner.invokeTestMethod(TestClassMethodsRunner.java:66)

                at
org.junit.internal.runners.TestClassMethodsRunner.run(TestClassMethodsRunner.java:35)

                at
org.junit.internal.runners.TestClassRunner$1.runUnprotected(TestClassRunner.java:42)

                at
org.junit.internal.runners.BeforeAndAfterRunner.runProtected(BeforeAndAfterRunner.java:34)

                at
org.junit.internal.runners.TestClassRunner.run(TestClassRunner.java:52)

                at
org.eclipse.swtbot.swt.finder.junit.SWTBotJunit4ClassRunner.run(SWTBotJunit4ClassRunner.java:55)

                at
org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:45)

                at
org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)

                at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)

                at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)

                at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)

                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:68)

                at java.lang.Thread.run(Unknown Source).



Please verify this issue.



In one of the SWTBot links it was specified that *Cannot access context
menu’s submenu items. Is this true??*

**

* *
*Please reply ASAP.*
**
**
**
Thanks
Miranda H
**
_______________________________________________
swtbot-dev mailing list
swtbot-dev@eclipse.org
https://dev.eclipse.org/mailman/listinfo/swtbot-dev

Reply via email to