method to select a menuItem object for opening Properties window of a project [message #774046] |
Tue, 03 January 2012 06:52 |
Padmanabhan Krishnan Messages: 2 Registered: January 2012 |
Junior Member |
|
|
I have SWTBot v2.0.5 installed on my Eclipse Helios R2 and I have been exploring SWTBot APIs.I am looking for a work around or alternative approach for a problem that is blocking our exploration with SWTBot.
I am trying to Open the "Properties" window of a project in the package explorer and set configurations parameters with SWTBot. While doing so, I used the "SWTBotMenu org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem.contextMenu(String text)" method to get the "Properties" menu item.
However, I could not get the match with the several text combinations like "Properties","Properties Alt+Enter","Properties Alt+Enter", "Properties Alt+Enter" and so on.I presume that either the text parameter passed is incorrect or the method is not capable to identify it. However, I did see that other menu actions items such as "Close Project","Open Project" were working as expected while using the above method.
It would be great if SWTBot users can share any work around or alternative approach for opening the Properties Window using SWTBot.Though this is a typical issue, I have not been able to identify alternate methods to overcome this problem. Thanks in advance!
Attaching the code snippet and log trace:
SWTBotTree packageExlorerTree = bot.viewByTitle("Project Explorer").bot().tree();
SWTBotTreeItem treeItem =packageExlorerTree.getTreeItem("MyProject");
treeItem.select();
treeItem.contextMenu("Properties").click();
Log Trace:
org.eclipse.swtbot.swt.finder.widgets.TimeoutException: Timeout after: 5000 ms.: Could not find context menu with text: Properties Alt+Enter
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:451)
at org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem.contextMenu(SWTBotTreeItem.java:553)
at org.eclipsecon.swtbot.example.CreateProject.configProject(CreateProject.java:79)
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.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.runChild(BlockJUnit4ClassRunner.java:76)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
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.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31)
at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
at org.eclipse.swtbot.swt.finder.junit.SWTBotJunit4ClassRunner.run(SWTBotJunit4ClassRunner.java:54)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:49)
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(Unknown Source)
[Updated on: Mon, 09 January 2012 11:12] Report message to a moderator
|
|
|
|
Powered by
FUDForum. Page generated in 0.04149 seconds