Exception with ComboItemLocator

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

Exception with ComboItemLocator

Postby Steffen8708 » Thu Nov 27, 2008 6:15 am

Hello,

I get the following exception when using the ComboItemLocator:

Code: Select all
org.eclipse.swt.SWTException: Widget is disposed
   at org.eclipse.swt.SWT.error(SWT.java:3374)
   at org.eclipse.swt.SWT.error(SWT.java:3297)
   at org.eclipse.swt.SWT.error(SWT.java:3268)
   at org.eclipse.swt.widgets.Widget.error(Widget.java:435)
   at org.eclipse.swt.widgets.Widget.getDisplay(Widget.java:545)
   at abbot.tester.swt.ComboTester.getSelectionIndex(ComboTester.java:91)
   at com.windowtester.event.selector.swt.ComboSelector$1ItemSelectionCondition.test(ComboSelector.java:92)
   at com.windowtester.internal.runtime.condition.ConditionMonitor.test(ConditionMonitor.java:180)
   at com.windowtester.runtime.swt.internal.UIContextSWT.wait(UIContextSWT.java:758)
   at com.windowtester.event.selector.swt.ComboSelector.verifySelection(ComboSelector.java:114)
   at com.windowtester.event.selector.swt.ComboSelector.click(ComboSelector.java:61)
   at com.windowtester.event.selector.swt.BasicWidgetSelector.click(BasicWidgetSelector.java:129)
   at com.windowtester.runtime.swt.locator.ComboItemLocator.click(ComboItemLocator.java:74)
   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:82)
   at com.windowtester.runtime.swt.internal.UIContextSWT.click(UIContextSWT.java:293)
   at com.windowtester.internal.runtime.UIContextCommon.click(UIContextCommon.java:75)
   at com.windowtester.runtime.swt.internal.UIContextSWT.click(UIContextSWT.java:301)
   at com.windowtester.internal.runtime.UIContextCommon.click(UIContextCommon.java:68)
   at com.windowtester.runtime.swt.internal.UIContextSWT.click(UIContextSWT.java:284)
   at mytest
   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:154)
   at junit.framework.TestCase.runBare(TestCase.java:127)
   at com.windowtester.runtime.common.UITestCaseCommon.access$001(UITestCaseCommon.java:25)
   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)



Installed Window Tester version is 3.6.0. It seems that the selection is made although the exception ocurrs.
Is this issue known?

Steffen
Steffen8708
 
Posts: 29
Joined: Tue Nov 04, 2008 7:11 am

Re: Exception with ComboItemLocator

Postby Steffen8708 » Thu Nov 27, 2008 6:16 am

(two items are in the combo, the first one i want to select by exact name match)
Steffen8708
 
Posts: 29
Joined: Tue Nov 04, 2008 7:11 am

Re: Exception with ComboItemLocator

Postby Phil Quitslund » Thu Dec 04, 2008 7:19 pm

This should not be an issue. In a nutshell here's what's going on:

1. we select the combo item you specify
2. we wait for the combo item to register the selection

In some cases, (the one you describe) the combo get's disposed before we can verify the selection (or really while we're verifying it). In general this is just a risk that comes with our extra verification step. Since the verification is sort of extra-credit, if it does not complete it's not a big deal. (Or so we think!) That said, we do log it in case it turns out to be...

Please let us know if this presents any issues.

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

Re: Exception with ComboItemLocator

Postby Steffen8708 » Tue Dec 09, 2008 6:54 am

Ok, i think it's no problem if the verification does not finish. The main desired behavior is to select the item. But it turned out that this is not the fact sometimes. And i have no idea why this happens. The combo is found and the item is in the list of the combo but the selection of that item is not made in same cases. This occurs also with version 3.6.1.

By the way, I wonder why combo gets disposed. The combo is still there and can also be used (e.g. by intervene in the automatic execution of the test) after the call to "ui.click(new ComboItemLocator...)". Therefore, verification of selection should be no problem by comparing the text of the combo with the text of desired item after the selection of the item. Maybe the list of the combo is disposed that appears when clicking on the button with the down arrow.

Steffen
Steffen8708
 
Posts: 29
Joined: Tue Nov 04, 2008 7:11 am

Re: Exception with ComboItemLocator

Postby Phil Quitslund » Thu Dec 11, 2008 7:41 pm

I think we should upgrade this to a bug report. Could you send a note to wintest-support@instantiations.com?

When we try and track it down it would be useful to have a repro. If you can send us any bits of context that would help us with that it will speed things up on our end. Thanks for following up!


-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