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 bee0000 » Fri Apr 04, 2008 4:41 am

Hello,

from time to time I get the following exception when trying to run a WindowTester test case. WindowTester seems not to be able to put the focus on the eclipse runtime instance... (I work with WT 2.3.1 [20080117085544] )

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:495)
at com.windowtester.runtime.swt.internal.UIContextSWT.find(UIContextSWT.java:430)
at com.windowtester.runtime.swt.locator.MenuItemLocator.click(MenuItemLocator.java:87)
at com.windowtester.internal.runtime.selector.ClickHelper.doClick(ClickHelper.java:178)
at com.windowtester.internal.runtime.selector.ClickHelper.click(ClickHelper.java:65)
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.bosch.blueworx.tests.util.TestUtilsGUI.openBwPerspective(TestUtilsGUI.java:29)
at com.bosch.blueworx.core.ui.navigator.filters.TestFilters.setUp(TestFilters.java:65)
at junit.framework.TestCase.runBare(TestCase.java:128)
at com.windowtester.runtime.common.UITestCaseCommon.access$001(UITestCaseCommon.java:26)
at com.windowtester.runtime.common.UITestCaseCommon$1.run(UITestCaseCommon.java:133)
at com.windowtester.runtime.common.UITestCaseCommon$2.run(UITestCaseCommon.java:150)
at com.windowtester.internal.runtime.junit.core.SequenceRunner$1.run(SequenceRunner.java:44)

Cheers,
Frank
bee0000
 
Posts: 4
Joined: Fri Apr 04, 2008 4:02 am

Re: UnableToFindActiveShellException

Postby Phil Quitslund » Fri Apr 04, 2008 10:52 am

The WT runtime uses the active SWT shell to scope its widget searches. This exception suggests that there was no active shell found, which can occur when the application loses focus. Is it possible that you moved the mouse or typed a key during test execution that may have cause the application to lose focus?

-phil
--
Phil Quitslund
Software Engineer
Google, Inc.
Phil Quitslund
Moderator
 
Posts: 491
Joined: Fri Apr 28, 2006 6:26 am

Re: UnableToFindActiveShellException

Postby bee0000 » Mon Apr 07, 2008 12:07 am

Hi Phil,

no, I'm sure that I didn't move the mouse - but the behaviour is as if I would do so. Maybe my mouse sensitity is two high ;-)

Best regards,
Frank
bee0000
 
Posts: 4
Joined: Fri Apr 04, 2008 4:02 am

Re: UnableToFindActiveShellException

Postby Phil Quitslund » Mon Apr 07, 2008 8:23 am

Maybe! Let us know if that persists. If it is at all consistent, we should dig deeper...
--
Phil Quitslund
Software Engineer
Google, Inc.
Phil Quitslund
Moderator
 
Posts: 491
Joined: Fri Apr 28, 2006 6:26 am

Re: UnableToFindActiveShellException

Postby kkkarthick » Tue Jun 03, 2008 5:48 am

I am also getting the same exception. Even though the cursor is on active shell only. It is not entering the path in the text box.
but the same source code runs successfully on different machine.

i used the source code :

ui.click(new MenuItemLocator("File/Open File..."));
ui.enterText("C:\\SQLForUser.sql");
ui.keyClick(WT.TAB);
ui.keyClick(WT.TAB);
ui.keyClick(WT.CR);

-karthick kk
kkkarthick
 
Posts: 3
Joined: Sun Jan 27, 2008 9:46 pm

Re: UnableToFindActiveShellException

Postby Phil Quitslund » Tue Jun 03, 2008 10:57 am

Hmmmm. That's a native dialog. I wonder if there is a timing issue. What OS are you using?

A quick thing to try would be to add a pause before the enterText() to make sure the dialog is up and the text box has focus.

Also, are you using a fairly recent build? (And are they the same on the different machines?) Over the last few months a number of fixes were introduced that may have addressed this issue.

Let us know if any of this helps!
--
Phil Quitslund
Software Engineer
Google, Inc.
Phil Quitslund
Moderator
 
Posts: 491
Joined: Fri Apr 28, 2006 6:26 am

Re: UnableToFindActiveShellException

Postby kkkarthick » Tue Jun 10, 2008 1:21 am

i tried on windows XP.

dialog gets appear and the foucus is on the text box only even without adding the pause code.
i tried to add the pause also. same error is giving.
yes both machines have the same and recent build. windowtester 3.0.0.200803061104

-karthick kk
kkkarthick
 
Posts: 3
Joined: Sun Jan 27, 2008 9:46 pm

Re: UnableToFindActiveShellException

Postby Phil Quitslund » Tue Jun 10, 2008 9:01 am

You might try the latest stable build on our development stream. It contains the fixes mentioned. The build you are using is the GA and a bit older...

http://download.instantiations.com/Wind ... 32_x86.exe
--
Phil Quitslund
Software Engineer
Google, Inc.
Phil Quitslund
Moderator
 
Posts: 491
Joined: Fri Apr 28, 2006 6:26 am

Re: UnableToFindActiveShellException

Postby EDWARD BOLLES » Tue Jun 17, 2008 9:42 am

When using the mouse to import files to eclipse, the recording will fail for me also. My solution is to first set "Clear workspace" in the recording dialogue. Then, I must type in paths with the keyboard. Pasting the path into the field will not work.
EDWARD BOLLES
 
Posts: 7
Joined: Tue Jun 17, 2008 9:02 am

Re: UnableToFindActiveShellException

Postby Phil Quitslund » Tue Jun 17, 2008 10:23 am

Do you mean using the mouse to drag and drop files to import? Or do you mean "CTRL-V" to paste? In both cases (for different reasons!) the recorder might have problems. That aside, the import wizard uses a native dialog for browsing and interacting with it requires exactly the work-around you propose. Thanks for this tip!
--
Phil Quitslund
Software Engineer
Google, Inc.
Phil Quitslund
Moderator
 
Posts: 491
Joined: Fri Apr 28, 2006 6:26 am

Re: UnableToFindActiveShellException

Postby EDWARD BOLLES » Tue Jun 17, 2008 10:38 am

Hi,

Yes, using the wizard to create or import files can be tricky as you mention. This is why I type in the paths like "C:\dir1\dir2\myfile" manually instead of opening directories with the mouse.

Thanks for the clarification.

Edward
EDWARD BOLLES
 
Posts: 7
Joined: Tue Jun 17, 2008 9:02 am

Re: UnableToFindActiveShellException

Postby Phil Quitslund » Tue Jun 17, 2008 11:25 am

Thank you! Please continue to share your experiences.

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