Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » SWTBot » WidgetNotFoundException: The widget was null.(WidgetNotFoundException: The widget was null.)
WidgetNotFoundException: The widget was null. [message #869399] Thu, 03 May 2012 06:47
Shailesh Charati is currently offline Shailesh Charati
Messages: 5
Registered: February 2011
Junior Member
Hi!

I am trying to automate tests for our RCP application using swtbot.I am new to swtbot and so I tried the following simple test and got the "WidgetNotFoundException: The widget was null" error:

public class SEViewTest {

private SWTWorkbenchBot bot;;

@Test
public void seViewExistsTest()
{
SWTBotMenu windowMenu = bot.menu( "Window" );
SWTBotMenu openPerspectiveMenu = windowMenu.menu( "Open Perspective" );
SWTBotMenu otherMenu = openPerspectiveMenu.menu( "Other..." );
SWTBotMenu otherMenuClick = otherMenu.click();
}


@Before
public void setUp()
{
bot = new SWTWorkbenchBot();
}


}

Following is the full trace of the error:

org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException: The widget was null.
at org.eclipse.swtbot.swt.finder.widgets.AbstractSWTBot.<init>(AbstractSWTBot.java:97)
at org.eclipse.swtbot.swt.finder.widgets.AbstractSWTBotControl.<init>(AbstractSWTBotControl.java:47)
at org.eclipse.swtbot.swt.finder.widgets.SWTBotShell.<init>(SWTBotShell.java:49)
at org.eclipse.swtbot.swt.finder.widgets.SWTBotShell.<init>(SWTBotShell.java:38)
at org.eclipse.swtbot.swt.finder.SWTBotFactory.activeShell(SWTBotFactory.java:341)
at org.eclipse.swtbot.swt.finder.SWTBotFactory.menu(SWTBotFactory.java:208)
at org.eclipse.swtbot.swt.finder.SWTBotFactory.menu(SWTBotFactory.java:198)
at SEViewTest.seViewExistsTest(SEViewTest.java:16)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
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.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
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.runners.ParentRunner.run(ParentRunner.java:236)
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(Thread.java:722)

Any suggestions/clues to get around this ?

Thanks in advance.


-Shailesh
Previous Topic:notify(SWT.MouseEnter) is not sent to the widget
Next Topic:Generate Test Report
Goto Forum:
  


Current Time: Wed Aug 20 04:59:05 EDT 2014

Powered by FUDForum. Page generated in 0.02281 seconds