Problem Timeout with ShellDisposedCondition

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

Problem Timeout with ShellDisposedCondition

Postby uweheldt » Thu Apr 01, 2010 5:01 am

Hi,

i encounter problems using the recorded code which contains an ShellDisposedCondition. On Playback time the result is:

com.windowtester.runtime.WaitTimedOutException: Timed out waiting for condition:
toString=ShellDisposedCondition: 'Lade Nachschlagedaten des Editors...'
class=com.windowtester.runtime.swt.condition.shell.ShellDisposedCondition
at com.windowtester.runtime.swt.internal.UIContextSWT.wait(UIContextSWT.java:823)
at com.windowtester.runtime.swt.internal.UIContextSWT.wait(UIContextSWT.java:795)
at com.windowtester.runtime.swt.internal.UIContextSWT.wait(UIContextSWT.java:788)
at de.kombiverkehr.kms.base.ui.BuchungTest.testBuchung(BuchungTest.java:34)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at junit.framework.TestCase.runTest(TestCase.java:164)
at junit.framework.TestCase.runBare(TestCase.java:130)
at com.windowtester.runtime.common.UITestCaseCommon.access$0(UITestCaseCommon.java:1)
at com.windowtester.runtime.common.UITestCaseCommon$2.run(UITestCaseCommon.java:136)
at com.windowtester.runtime.common.UITestCaseCommon$3.run(UITestCaseCommon.java:157)
at com.windowtester.internal.runtime.junit.core.SequenceRunner$1.run(SequenceRunner.java:46)

Whats wrong?

The test code is:
public class BuchungTest extends UITestCaseSWT {

/* @see junit.framework.TestCase#setUp()
*/
protected void setUp() throws Exception {
super.setUp();
IUIContext ui = getUI();
ui.ensureThat(new WorkbenchLocator().hasFocus());
ui.ensureThat(ViewLocator.forName("Welcome").isClosed());
}

/**
* Main test method.
*/
public void testBuchung() throws Exception {
IUIContext ui = getUI();
ui.click(new MenuItemLocator("Buchung/Neue Buchung erfassen"));
ui.wait(new ShellDisposedCondition(
"Lade Nachschlagedaten des Editors..."));
ui.click(new LabeledTextLocator("Buchender Kunde:"));
ui.enterText("Paneur");
ui.wait(new ShellShowingCondition(""));
ui.click(2, new TableItemLocator(
"PANEUROPA (73600, Paneuropa - Rösch GmbH)"));
ui.click(new LabeledTextLocator("Quelle Buchungsdaten:"));
ui.wait(new ShellShowingCondition(""));
ui.click(2, new TableItemLocator("Fax"));
ui.click(new TableItemLocator("",
new SWTWidgetLocator(Table.class, new LabeledTextLocator("Buchungspositionen"))));
ui.enterText("PANEUR");
ui.wait(new ShellShowingCondition(""));
ui.click(2, new TableItemLocator(
"PANEUROPA (73600, Paneuropa - Rösch GmbH)"));
ui.ensureThat(new ShellLocator(
"KMS - Kombiverkehr Kapazitätsmanagementsystem [null]")
.isClosed());
ui.wait(new ShellDisposedCondition("Progress Information"));
ui.wait(new ShellShowingCondition("Save Resource"));
ui.click(new ButtonLocator("&No"));
ui.wait(new ShellDisposedCondition("Save Resource"));
ui.wait(new ShellDisposedCondition(
"KMS - Kombiverkehr Kapazitätsmanagementsystem [null]"));
}
uweheldt
 
Posts: 4
Joined: Thu Apr 01, 2010 4:57 am

Re: Problem Timeout with ShellDisposedCondition

Postby Phil Quitslund » Thu Apr 01, 2010 9:17 am

Did the recorder miss some interactions? Were there some missed actions between (1) and (2) below?

Code: Select all
ui.click(new MenuItemLocator("Buchung/Neue Buchung erfassen"));              //1
ui.wait(new ShellDisposedCondition("Lade Nachschlagedaten des Editors...")); //2

What actions are performed that should cause the 'Lade Nachschlagedaten des Editors...' shell to close?
--
Phil Quitslund
Software Engineer
Google, Inc.
Phil Quitslund
Moderator
 
Posts: 491
Joined: Fri Apr 28, 2006 6:26 am

Re: Problem Timeout with ShellDisposedCondition

Postby uweheldt » Thu Apr 01, 2010 10:21 am

Did the recorder miss some interactions? Were there some missed actions between (1) and (2) below?


Code: Select all
ui.click(new MenuItemLocator("Buchung/Neue Buchung erfassen")); //1
ui.wait(new ShellDisposedCondition("Lade Nachschlagedaten des Editors...")); //2
What actions are performed that should cause the 'Lade Nachschlagedaten des Editors...' shell to close?

No, there are no actions between (1) and (2)
(1) opens a view and
(2) show a dialog to wait until all required data is loaded from the backend. This may take a minute or two. You can't continue until the dialog is ready

The "Lade Nachschlagedaten des Editors..." shell is closed as soon as all required data is loaded. This may take a minite or two...

Any suggestions?
uweheldt
 
Posts: 4
Joined: Thu Apr 01, 2010 4:57 am

Re: Problem Timeout with ShellDisposedCondition

Postby uweheldt » Thu Apr 01, 2010 11:15 am

as soon as I add a timeout like
ui.wait(new ShellDisposedCondition(
"Lade Nachschlagedaten des Editors..."), 120000);

i receive another exception.

The shell is like a progress window for some background action. All further actions must wait for this. Unfortunately this seems not to work????

com.windowtester.runtime.WaitTimedOutException: Quit waiting for UI thread to execute callable 1270148897931
Elapse time: 10016
Max wait time: 10000
at com.windowtester.runtime.swt.internal.widgets.SWTUIExecutor.run(SWTUIExecutor.java:115)
at com.windowtester.runtime.swt.internal.widgets.DisplayReference.execute(DisplayReference.java:126)
at com.windowtester.runtime.swt.internal.widgets.DisplayReference.execute(DisplayReference.java:105)
at com.windowtester.runtime.swt.internal.widgets.finder.SWTWidgetFinder.doFindAll(SWTWidgetFinder.java:106)
at com.windowtester.runtime.swt.internal.widgets.finder.SWTWidgetFinder.findAll(SWTWidgetFinder.java:100)
at com.windowtester.runtime.swt.condition.shell.ShellDisposedCondition.testCondition(ShellDisposedCondition.java:56)
at com.windowtester.runtime.swt.condition.shell.TestAndWaitForIdleCondition.test(TestAndWaitForIdleCondition.java:45)
at com.windowtester.internal.runtime.condition.ConditionMonitor.test(ConditionMonitor.java:180)
at com.windowtester.runtime.swt.internal.UIContextSWT.wait(UIContextSWT.java:809)
at com.windowtester.runtime.swt.internal.UIContextSWT.wait(UIContextSWT.java:795)
at de.kombiverkehr.kms.base.ui.BuchungTest.testBuchung(BuchungTest.java:36)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at junit.framework.TestCase.runTest(TestCase.java:164)
at junit.framework.TestCase.runBare(TestCase.java:130)
at com.windowtester.runtime.common.UITestCaseCommon.access$0(UITestCaseCommon.java:1)
at com.windowtester.runtime.common.UITestCaseCommon$2.run(UITestCaseCommon.java:136)
at com.windowtester.runtime.common.UITestCaseCommon$3.run(UITestCaseCommon.java:157)
at com.windowtester.internal.runtime.junit.core.SequenceRunner$1.run(SequenceRunner.java:46)
uweheldt
 
Posts: 4
Joined: Thu Apr 01, 2010 4:57 am

Re: Problem Timeout with ShellDisposedCondition

Postby Phil Quitslund » Mon Apr 12, 2010 10:18 am

This looks like an issue to bring to a support engineer. Please send a mail to

wintest-support@instantiations.com

with a description of the issue (a back-pointer to this post will suffice).

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

Re: Problem Timeout with ShellDisposedCondition

Postby sagar.shg » Tue Apr 27, 2010 1:22 am

I'm also facing a similar issue. 9/10 times I come across this issue. Is there any workaround for this??

Please note, I'm facing this only after upgrading to 5.0.

Thanks,
Sagar.
sagar.shg
 
Posts: 13
Joined: Tue Nov 17, 2009 10:22 pm

Re: Problem Timeout with ShellDisposedCondition

Postby Phil Quitslund » Tue Apr 27, 2010 8:00 am

Interesting... The good news is if you are seeing this problem so consistently, we should be able to reproduce it on our end (as of yet we have not). Could you follow up with a mail to support that contains as many details as you can? Once we can reproduce the issue, I'm sure our team can quickly resolve it.

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

Re: Problem Timeout with ShellDisposedCondition

Postby torrejonv » Thu Sep 23, 2010 2:19 am

Hi,

Has any solution been found for this issue?

I seem to consistently get it in certain areas of my application, and intermittently in some others, which makes testing impossible for me at the moment.

I would appreciate any advice.

Thanks!
torrejonv
 
Posts: 1
Joined: Thu Sep 23, 2010 1:48 am

Re: Problem Timeout with ShellDisposedCondition

Postby keertip » Mon Sep 27, 2010 1:59 pm

We are not able to reproduce this problem at our end. Would it be possible for you to post a test or a snippet of code to help us with the repro?
keertip
Moderator
 
Posts: 221
Joined: Thu Mar 15, 2007 10:26 am

Re: Problem Timeout with ShellDisposedCondition

Postby jtonic » Mon Oct 04, 2010 8:47 am

I am also facing this issue on Eclipse-3.5.2.
It occurs in the moment my CDT project is created.
As soon as the CDT New Project Wizard is finished a full build is started, and it could take a minute or two.
The problem is
Code: Select all
ui.wait(new ShellDisposedCondition...

I've tried to use all wait methods, but without success.

What can I do against this? Can I use an assertHook or ProgressManager in order to address this issue?
Did anyone get a workaround for this?
jtonic
 
Posts: 1
Joined: Mon Oct 04, 2010 8:32 am

Re: Problem Timeout with ShellDisposedCondition

Postby keertip » Mon Oct 04, 2010 11:30 am

Could you post your test and the exception stack trace.
keertip
Moderator
 
Posts: 221
Joined: Thu Mar 15, 2007 10:26 am

Re: Problem Timeout with ShellDisposedCondition

Postby mbykovksyy » Wed Jan 26, 2011 6:23 am

I see this problem from time to time as well. The last time it timed out getting an active shell. I believe this is due to the fact that UI thread is busy doing something and is taking too long to execute WindowTester's callable. This happens when you put expensive operations into gui thread. The default max waiting time is 10 seconds and, unfortunately, there's no way to change it as it's hardcoded in DisplayReference#execute(Callable).
mbykovksyy
 
Posts: 8
Joined: Mon Sep 20, 2010 8:55 am

Re: Problem Timeout with ShellDisposedCondition

Postby keertip » Wed Jan 26, 2011 12:01 pm

Thanks for the information!
keertip
Moderator
 
Posts: 221
Joined: Thu Mar 15, 2007 10:26 am


Return to Window Tester

Who is online

Users browsing this forum: No registered users and 1 guest