UnableToFindActiveShellException

WindowTester allows you to easily create and run unit tests for every GUI they build. It can also be used to generate system level tests.

Moderators: gnebling, Eric Clayberg, Dan Rubel, keertip, Phil Quitslund

UnableToFindActiveShellException

Postby THilde » Tue Mar 18, 2008 12:50 am

Hi,

I recorded a test for a RCP Application, which went well. It looks like this:

....
public void testout() throws Exception {
IUIContext ui = getUI();
ui.click(new TableItemLocator("0004490", new ViewLocator(
"com.saf.cockpit.viewers.OrderTableView")));
ui
.click(new XYLocator(new CTabItemLocator("Exception Details"),
86, 12));
ui.click(new TableItemLocator("0004482", new ViewLocator(
"com.saf.cockpit.viewers.OrderTableView")));
ui.click(new TableItemLocator("0004497", new ViewLocator(
"com.saf.cockpit.viewers.OrderTableView")));
}
....

The problem is, when I run this test again as Junit-Plugin Test as stated in your tutorials, my RCP Application starts just fine, but instead of executing
the test, I get the error:

com.windowtester.runtime.swt.finder.UnableToFindActiveShellException
at com.windowtester.finder.swt.WidgetFinderService.collectMatches(WidgetFinderService.java:74)
at com.windowtester.finder.swt.SWTWidgetFinder.findAll(SWTWidgetFinder.java:67)
at com.windowtester.runtime.WidgetLocator.findAll(WidgetLocator.java:417)
at com.windowtester.runtime.swt.internal.UIContextSWT.findAll(UIContextSWT.java:493)
at com.windowtester.runtime.swt.internal.UIContextSWT.find(UIContextSWT.java:428)
at com.windowtester.runtime.swt.internal.UIContextSWT.find(UIContextSWT.java:440)
at com.windowtester.runtime.swt.internal.UIContextSWT.find(UIContextSWT.java:440)
at com.windowtester.runtime.swt.internal.UIContextSWT.find(UIContextSWT.java:440)
at com.windowtester.runtime.swt.internal.UIContextSWT.find(UIContextSWT.java:440)
at com.windowtester.internal.runtime.selector.ClickHelper.doFind(ClickHelper.java:192)
at com.windowtester.internal.runtime.selector.ClickHelper.click(ClickHelper.java:58)
at com.windowtester.internal.runtime.UIContextCommon.click(UIContextCommon.java:75)
at com.windowtester.runtime.swt.internal.UIContextSWT.click(UIContextSWT.java:277)
at com.windowtester.internal.runtime.UIContextCommon.click(UIContextCommon.java:68)
at com.windowtester.runtime.swt.internal.UIContextSWT.click(UIContextSWT.java:285)
at com.windowtester.internal.runtime.UIContextCommon.click(UIContextCommon.java:61)
at com.windowtester.runtime.swt.internal.UIContextSWT.click(UIContextSWT.java:268)
at com.saf.cockpit.test.out.testout(out.java:17)
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 junit.framework.TestCase.runTest(TestCase.java:164)
at junit.framework.TestCase.runBare(TestCase.java:130)
at junit.extensions.UITestCaseCommon.access$101(UITestCaseCommon.java:26)
at junit.extensions.UITestCaseCommon$1.run(UITestCaseCommon.java:140)
at junit.extensions.core.SequenceRunner$1.run(SequenceRunner.java:44)

Google does not give any information on this exception except one of your pages, but the information is not very helpful. Could you explain to me in more detail, what that exception could mean, what I could have done wrong?

Thanks in advance.
THilde
 
Posts: 1
Joined: Tue Mar 18, 2008 12:44 am

Re: UnableToFindActiveShellException

Postby Phil Quitslund » Thu Mar 20, 2008 8:07 am

The WT runtime scopes its widget search by the currently active shell. This exception indicates that it could not find one... Did your application lose focus when you ran the test? (Note that the runtime takes control of the mouse, so anything you do with it while the test is running may interfere...)
--
Phil Quitslund
Software Engineer
Google, Inc.
Phil Quitslund
Moderator
 
Posts: 491
Joined: Fri Apr 28, 2006 6:26 am


Return to Window Tester

Who is online

Users browsing this forum: No registered users and 1 guest