i have a Combobox in the application which has 8 items. The items are named 1,2,3,... and so on.
I need to select a specified item (in this case the item named "4").
Code for selecting an item:
- Code: Select all
ui.click(new ComboItemLocator("4", new LabeledLocator(Combo.class, "Comboname")));
With this code the Comboitemlocator doesn't select the item "4" but the following item ("5") and i get the following stacktrace:
- Code: Select all
org.eclipse.swt.SWTException: Failed to execute runnable (org.eclipse.swt.SWTException: Widget is disposed)
at org.eclipse.swt.SWT.error(SWT.java:3563)
at org.eclipse.swt.SWT.error(SWT.java:3481)
at org.eclipse.swt.widgets.Synchronizer.syncExec(Synchronizer.java:178)
at org.eclipse.ui.internal.UISynchronizer.syncExec(UISynchronizer.java:118)
at org.eclipse.swt.widgets.Display.syncExec(Display.java:4097)
at com.windowtester.event.selector.swt.ComboSelector.getIndex(ComboSelector.java:272)
at com.windowtester.event.selector.swt.ComboSelector.forceSelection(ComboSelector.java:132)
at com.windowtester.event.selector.swt.ComboSelector.click(ComboSelector.java:67)
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:83)
at com.windowtester.runtime.swt.internal.UIContextSWT.click(UIContextSWT.java:290)
at com.windowtester.internal.runtime.UIContextCommon.click(UIContextCommon.java:76)
at com.windowtester.runtime.swt.internal.UIContextSWT.click(UIContextSWT.java:298)
at com.windowtester.internal.runtime.UIContextCommon.click(UIContextCommon.java:69)
at com.windowtester.runtime.swt.internal.UIContextSWT.click(UIContextSWT.java:281)
...
If i want to select the last element in this combo ("8") everything works fine.
I have tested this behaviour with 3.0.0Release and the latest build 3.0.1 (from 10.06.2008).
Thanks