Skip to main content

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 10:47
Shailesh Charati is currently offline Shailesh CharatiFriend
Messages: 5
Registered: February 2011
Junior Member

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;;

public void seViewExistsTest()
SWTBotMenu windowMenu = "Window" );
SWTBotMenu openPerspectiveMenu = "Open Perspective" );
SWTBotMenu otherMenu = "Other..." );
SWTBotMenu otherMenuClick =;

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>(
at org.eclipse.swtbot.swt.finder.widgets.AbstractSWTBotControl.<init>(
at org.eclipse.swtbot.swt.finder.widgets.SWTBotShell.<init>(
at org.eclipse.swtbot.swt.finder.widgets.SWTBotShell.<init>(
at org.eclipse.swtbot.swt.finder.SWTBotFactory.activeShell(
at SEViewTest.seViewExistsTest(
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(
at sun.reflect.DelegatingMethodAccessorImpl.invoke(
at java.lang.reflect.Method.invoke(
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(
at org.junit.runners.model.FrameworkMethod.invokeExplosively(
at org.junit.internal.runners.statements.InvokeMethod.evaluate(
at org.junit.internal.runners.statements.RunBefores.evaluate(
at org.junit.runners.BlockJUnit4ClassRunner.runChild(
at org.junit.runners.BlockJUnit4ClassRunner.runChild(
at org.junit.runners.ParentRunner$
at org.junit.runners.ParentRunner$1.schedule(
at org.junit.runners.ParentRunner.runChildren(
at org.junit.runners.ParentRunner.access$000(
at org.junit.runners.ParentRunner$2.evaluate(
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(
at org.eclipse.swtbot.eclipse.core.RemotePluginTestRunner.main(
at org.eclipse.swtbot.eclipse.core.UITestApplication.runTests(
at org.eclipse.ui.internal.testing.WorkbenchTestable$

Any suggestions/clues to get around this ?

Thanks in advance.

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

Current Time: Tue Oct 04 13:40:47 GMT 2022

Powered by FUDForum. Page generated in 0.02243 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top