|
Re: WidgetNotFound when looking for menu item? [message #508028 is a reply to message #507870] |
Fri, 15 January 2010 15:16 |
Pascal G Messages: 157 Registered: July 2009 |
Senior Member |
|
|
Robert M. Fuhrer wrote:
> srcEditor.setFocus(); // necessary?
No, since the setFocus() doesn't do anything right now...
> When this code begins to run, the variable 'srcEditor' refers to a Java
> editor containing a class with an appropriate main(String[]) method (a
> subsequent part of the test successfully executes this main() method).
> Moreover, this editor has focus, so I think the call to setFocus() is
> unnecessary.
>
> Any clues as to why this fails?
>
I'd like to know more about your failure. Is it an assert that fails or
an exception? What's the error message? At which line does it fail?
Also, I haven't tested much the menus with SWTBot, only thing I can say
is that sometime some of my tests fail because they can't find the File
menu... however, I haven't tried to consistently reproduce this
behavior, so it doesn't really classify as a bug, yet.
--
Pascal Gélinas | Software Developer
*Nu Echo Inc.*
http://www.nuecho.com/ | http://blog.nuecho.com/
*Because performance matters.*
|
|
|
Re: WidgetNotFound when looking for menu item? [message #508098 is a reply to message #508028] |
Fri, 15 January 2010 21:42 |
Robert M. Fuhrer Messages: 294 Registered: July 2009 |
Senior Member |
|
|
It fails with a WidgetNotFoundException at the line that reads
SWTBotMenu runJavaAppItem = runAsMenu.menu("Java Application");
Here's the backtrace:
org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundExcep tion: The widget was null.
at org.eclipse.swtbot.swt.finder.widgets.AbstractSWTBot.<init>(AbstractSWTBot.java:97)
at org.eclipse.swtbot.swt.finder.widgets.SWTBotMenu.<init>(SWTBotMenu.java:42)
at org.eclipse.swtbot.swt.finder.widgets.SWTBotMenu.menu(SWTBot Menu.java:96)
at swtbot.example.SWTTest1.jdtSmokeTest(SWTTest1.java:227)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce ssorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe thodAccessorImpl.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(Refl ectiveCallable.java:15)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(Fr ameworkMethod.java:41)
at org.junit.internal.runners.statements.InvokeMethod.evaluate( InvokeMethod.java:20)
at org.junit.internal.runners.statements.RunBefores.evaluate(Ru nBefores.java:28)
at org.junit.internal.runners.statements.RunAfters.evaluate(Run Afters.java:31)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit 4ClassRunner.java:73)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit 4ClassRunner.java:46)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java :180)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java: 41)
at org.junit.runners.ParentRunner$1.evaluate(ParentRunner.java: 173)
at org.junit.internal.runners.statements.RunBefores.evaluate(Ru nBefores.java:28)
at org.junit.internal.runners.statements.RunAfters.evaluate(Run Afters.java:31)
at org.junit.runners.ParentRunner.run(ParentRunner.java:220)
at org.eclipse.swtbot.swt.finder.junit.SWTBotJunit4ClassRunner. run(SWTBotJunit4ClassRunner.java:54)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.r un(JUnit4TestReference.java:46)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(Test Execution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTe sts(RemoteTestRunner.java:467)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTe sts(RemoteTestRunner.java:683)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(R emoteTestRunner.java:390)
at org.eclipse.swtbot.eclipse.core.RemotePluginTestRunner.main( RemotePluginTestRunner.java:64)
at org.eclipse.swtbot.eclipse.core.UITestApplication.runTests(U ITestApplication.java:117)
at org.eclipse.ui.internal.testing.WorkbenchTestable$1.run(Work benchTestable.java:71)
at java.lang.Thread.run(Thread.java:637)
On 1/15/10 10:16 AM, Pascal Gelinas wrote:
> Robert M. Fuhrer wrote:
>
>> srcEditor.setFocus(); // necessary?
>
> No, since the setFocus() doesn't do anything right now...
>
>> When this code begins to run, the variable 'srcEditor' refers to a Java
>> editor containing a class with an appropriate main(String[]) method (a
>> subsequent part of the test successfully executes this main() method).
>> Moreover, this editor has focus, so I think the call to setFocus() is
>> unnecessary.
>>
>> Any clues as to why this fails?
>>
>
> I'd like to know more about your failure. Is it an assert that fails or
> an exception? What's the error message? At which line does it fail?
>
> Also, I haven't tested much the menus with SWTBot, only thing I can say
> is that sometime some of my tests fail because they can't find the File
> menu... however, I haven't tried to consistently reproduce this
> behavior, so it doesn't really classify as a bug, yet.
--
Cheers,
-- Bob
--------------------------------
Robert M. Fuhrer
Research Staff Member
Programming Technologies Dept.
IBM T.J. Watson Research Center
IDE Meta-tooling Platform Project Lead (http://www.eclipse.org/imp)
X10: Productive High-Performance Parallel Programming (http://x10.sf.net)
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04597 seconds