ComboItemLocater selects wrong Item

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

ComboItemLocater selects wrong Item

Postby a.bitsche » Tue Jun 17, 2008 11:10 pm

Hello guys,

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
a.bitsche
 
Posts: 31
Joined: Tue Aug 22, 2006 2:53 am
Location: Austria

Re: ComboItemLocater selects wrong Item

Postby Phil Quitslund » Fri Jun 20, 2008 12:30 pm

This looks like a bug. Could you send a report to support where we can track it?

wintest-support@instantiations.com

The first thing we'll need to do is try and reproduce the issue. In the report, could you please include anything that might help us recreate the situation? In particular, can you think of anything that might cause the combo to get disposed? Is there validation on the combo selection? Is there anything that is programatically setting (or constraining) values on the combo?

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

Re: ComboItemLocater selects wrong Item

Postby EDWARD BOLLES » Thu Jun 26, 2008 11:49 am

WindowTester: WindowTesterPro_v3.0.1.200806101125
Eclipse: Eclipse SDK 3.3.1.1
Use: Evaluation


Hi,
I am also having trouble with the ComboItemLocator.

ComboItemLocator arguments are recorded, but upon playback, the combo selections are not made.

This is the recorded script:

/* EDIT OBJECT PROPERTIES IN PROPERTIES VIEW */
import com.windowtester.runtime.swt.locator.CTabItemLocator;
import com.windowtester.runtime.swt.UITestCaseSWT;
import com.windowtester.runtime.IUIContext;
import com.windowtester.runtime.swt.locator.MenuItemLocator;
import com.windowtester.runtime.swt.condition.shell.ShellShowingCondition;
import com.windowtester.runtime.swt.locator.TableItemLocator;
import com.windowtester.runtime.swt.locator.ButtonLocator;
import com.windowtester.runtime.swt.condition.shell.ShellDisposedCondition;
import com.windowtester.runtime.swt.locator.SWTWidgetLocator;
import org.eclipse.swt.widgets.Tree;
import com.windowtester.runtime.swt.locator.eclipse.ViewLocator;
import com.windowtester.runtime.swt.locator.FilteredTreeItemLocator;
import com.windowtester.runtime.WT;
import com.windowtester.runtime.swt.locator.TreeItemLocator;
import com.windowtester.runtime.swt.locator.ComboItemLocator;
import com.windowtester.runtime.swt.locator.LabeledTextLocator;

public class propertiesView extends UITestCaseSWT {

/**
* Main test method.
*/
public void testpropertiesView() throws Exception {
IUIContext ui = getUI();
ui.close(new CTabItemLocator("Welcome"));
ui.click(new MenuItemLocator("Window/Open Perspective/Other..."));
ui.wait(new ShellShowingCondition("Open Perspective"));
ui.click(new TableItemLocator("RCPApplication"));
ui.click(new ButtonLocator("OK"));
ui.wait(new ShellDisposedCondition("Open Perspective"));
ui.contextClick(new SWTWidgetLocator(Tree.class, new ViewLocator(
"org.eclipse.ui.navigator.ProjectExplorer")),
"&Import/&Import...");
ui.wait(new ShellShowingCondition("Import"));
ui.click(new FilteredTreeItemLocator("General"));
ui.click(new FilteredTreeItemLocator(
"General/Existing Projects into Workspace"));
ui.click(new ButtonLocator("&Next >"));
ui.enterText("U:\\dir\\Project");
ui.keyClick(WT.CR);
ui.click(new ButtonLocator("&Finish"));
ui.wait(new ShellDisposedCondition("Import"));
ui.contextClick(new TreeItemLocator(
"Project/bpel/Process.bpel", new ViewLocator(
"org.eclipse.ui.navigator.ProjectExplorer")), "Open");
ui.contextClick(new TreeItemLocator("Process/Process Activities",
new ViewLocator("org.eclipse.ui.views.ContentOutline")),
"Add/Activity/Receive");

/* ComboItemLocator methods */
ui.click(new ComboItemLocator("inputPartnerLink", new ViewLocator(
"org.eclipse.ui.views.PropertySheet")));
ui.click(new ComboItemLocator("dataRequestOperation", new ViewLocator(
"org.eclipse.ui.views.PropertySheet")));
ui.click(new ComboItemLocator("dataRequestVar", new ViewLocator(
"org.eclipse.ui.views.PropertySheet")));



ui.click(new LabeledTextLocator("Activity Name:", new ViewLocator(
"org.eclipse.ui.views.PropertySheet")));
ui.enterText("nameReceive");
ui.keyClick(WT.CR);
ui.keyClick(WT.CR);
ui.close(new CTabItemLocator("Process.bpel"));
ui.contextClick(new TreeItemLocator("Project", new ViewLocator(
"org.eclipse.ui.navigator.ProjectExplorer")), "Delete");
ui.wait(new ShellShowingCondition("Confirm Project Delete"));
ui.click(new ButtonLocator("&Yes"));
ui.wait(new ShellDisposedCondition("Confirm Project Delete"));
ui.wait(new ShellDisposedCondition("Progress Information"));
ui.wait(new ShellShowingCondition("Deleting resources"));
ui.wait(new ShellDisposedCondition("Deleting resources"));
}

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

Re: ComboItemLocater selects wrong Item

Postby Phil Quitslund » Thu Jun 26, 2008 12:26 pm

Hmmm... Are not selections being made or just incorrect ones? Are any exceptions thrown? Is there anything interesting in the log of the workspace for the app. under test?
--
Phil Quitslund
Software Engineer
Google, Inc.
Phil Quitslund
Moderator
 
Posts: 491
Joined: Fri Apr 28, 2006 6:26 am

Re: ComboItemLocater selects wrong Item

Postby maurice » Mon Mar 09, 2009 1:32 am

Hi,

i have still the same problem in version 3.6.1.

I want to select a item which is nearly the last in this combobox, but always the second item is selected.
So I can only choose the first or second item, all the others are not selectable.

Edit: The item i want to select is "Subtree OF", with items, which contain only one word it seems to wotk fine.
maurice
 
Posts: 1
Joined: Fri Dec 19, 2008 2:49 am

Re: ComboItemLocater selects wrong Item

Postby Phil Quitslund » Mon Mar 09, 2009 9:29 am

This sounds like a bug for us to investigate. Could you please open a ticket by sending a mail to support?

wintest-support@instantiations.com

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

Re: ComboItemLocater selects wrong Item

Postby arpitdesai » Thu Apr 16, 2009 7:15 am

Hi,

I am trialing version 3.8.0 and ran into the same issue. ComboItem does not get found during playback.

While recording the script generated is

ui.click(new ComboItemLocator("CSC.cc.cmb RV", new ViewLocator(
"xyz.ui.views.queryview")));

However, when I run it the playback errors out with WidgetNotFoundException

I found a workaround by naming my combo and using NamedWidgetLocator. code below works fine.
ui.click(new ComboItemLocator("CSC.cc.cmb RV", new NamedWidgetLocator(
Combo.class, "pdqcombo")));

Hope it helps,

- Arpit
arpitdesai
 
Posts: 6
Joined: Thu Apr 16, 2009 6:56 am

Re: ComboItemLocater selects wrong Item

Postby Phil Quitslund » Thu Apr 16, 2009 8:52 pm

Thanks for this. We're working on a proper fix so hopefully workarounds won't be needed for long!
--
Phil Quitslund
Software Engineer
Google, Inc.
Phil Quitslund
Moderator
 
Posts: 491
Joined: Fri Apr 28, 2006 6:26 am

Re: ComboItemLocater selects wrong Item

Postby nsajjan » Mon Feb 01, 2010 8:42 am

Hi,
I am using the 4.0.0 Eval version of WindoTesterPro and the ComboItemLocator is not selecting the right item from the drop down list. Here is the code line:

Code: Select all
ui.click(new ComboItemLocator("ADSP-BF537", new SWTWidgetLocator(Combo.class, 0, new SWTWidgetLocator(Composite.class))));


During the playback, I see that the option "ADSP-BF537" is getting selected in the UI, but the subsequent build command is seen to always receive the option "ADSP-BF512" - which is the default 1st option. Is the above code line correct or is there another way to do it?

Thanks,
NS
nsajjan
 
Posts: 4
Joined: Thu Jan 28, 2010 7:26 am

Re: ComboItemLocater selects wrong Item

Postby Phil Quitslund » Mon Feb 01, 2010 10:46 am

Hey there. This has been fixed in a more recent beta. Please grab our latest beta build and try again.

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

Re: ComboItemLocater selects wrong Item

Postby Phil Quitslund » Wed Apr 07, 2010 1:26 pm

The latest release is 5.0. We expect to ship a new beta 5.0.1 on Friday.
--
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