WindowTester not able to click combo item in property sheet

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

WindowTester not able to click combo item in property sheet

Postby har_shan » Wed Oct 06, 2010 5:39 am

We have a property sheet where
Property - is just a string
Value - can be any widget (drop down or multi select or any custom editor)

While testing the drop down widget (a combo item list, basically), it seems that WindowTester is unable to locate it and hence unable to choose the desired item in it.

Recording generates following snippet:

Code: Select all
// click desired prop in prop sheet
ui.click(new TreeItemLocator("PropertyName",
            new ViewLocator("org.eclipse.ui.views.PropertySheet")));
// bring drop down list
// XXX WindowTester does this by clicking the combo box by the name of then present item value
ui.click(new CComboItemLocator("PropertyDefaultValueDisplayed", new ViewLocator(
            "org.eclipse.ui.views.PropertySheet")));
// choose desired value
ui.click(new CComboItemLocator("PropertyCustomValueThatWeWantToChooseInList", new ViewLocator(
            "org.eclipse.ui.views.PropertySheet")));


Still, while playing i.e. running test, it fails saying:

Code: Select all
com.windowtester.runtime.WidgetNotFoundException: Widget NOT Found:
CComboItemLocator("PropertyDefaultValueDisplayed")
   at com.windowtester.runtime.swt.internal.UIContextSWT.find(UIContextSWT.java:603)
   at com.windowtester.runtime.swt.internal.UIContextSWT.find(UIContextSWT.java:578)
   at com.windowtester.runtime.swt.internal.UIContextSWT.find(UIContextSWT.java:578)
   at com.windowtester.runtime.swt.internal.UIContextSWT.find(UIContextSWT.java:578)
   at com.windowtester.runtime.swt.internal.UIContextSWT.find(UIContextSWT.java:578)
   at com.windowtester.runtime.swt.internal.UIContextSWT.find(UIContextSWT.java:578)
   at com.windowtester.runtime.swt.internal.UIContextSWT.find(UIContextSWT.java:578)
   at com.windowtester.runtime.swt.internal.UIContextSWT.find(UIContextSWT.java:578)
   at com.windowtester.runtime.swt.internal.UIContextSWT.find(UIContextSWT.java:578)
   at com.windowtester.runtime.swt.internal.UIContextSWT.find(UIContextSWT.java:578)
   at com.windowtester.runtime.swt.internal.UIContextSWT.find(UIContextSWT.java:578)
   at com.windowtester.runtime.swt.locator.CComboItemLocator.click(CComboItemLocator.java:62)
   at com.windowtester.internal.runtime.selector.ClickHelper.doClick(ClickHelper.java:172)
   at com.windowtester.internal.runtime.selector.ClickHelper.click(ClickHelper.java:59)
   at com.windowtester.internal.runtime.UIContextCommon.click(UIContextCommon.java:140)
   at com.windowtester.runtime.swt.internal.UIContextSWT.click(UIContextSWT.java:325)
   at com.windowtester.internal.runtime.UIContextCommon.click(UIContextCommon.java:133)
   at com.windowtester.runtime.swt.internal.UIContextSWT.click(UIContextSWT.java:333)
   at com.windowtester.internal.runtime.UIContextCommon.click(UIContextCommon.java:126)
   at com.windowtester.runtime.swt.internal.UIContextSWT.click(UIContextSWT.java:295)


We suspect that this might be because of 2 reasons:
1. The drop down widget itself is not initialized for some reasons, when tool tries to locate that (but however, am able to manually click and see drop down list when test is in progress)
2. We see that the actual drop down editor i.e. combo editor, in our case, is implemented in this way:

Code: Select all
public class DropdownCellEditor extends ComboBoxCellEditor {
..
..


But this is what we see in javadoc of ComboBoxCellEditor

This class may be instantiated; it is not intended to be subclassed.
Restriction:
This class is not intended to be subclassed by clients.


Attached is the the drop down combo look n feel in prop sheet

Any pointers? Thanks in advance.
Attachments
prop-sheet.JPG
drop down combo look n feel in prop sheet
prop-sheet.JPG (25 KiB) Viewed 333 times
har_shan
 
Posts: 5
Joined: Tue Mar 30, 2010 10:10 am

Re: WindowTester not able to click combo item in property sh

Postby har_shan » Sun Oct 10, 2010 8:36 pm

Could anyone please have a look?
Let me know if you need more info.
Thanks.
har_shan
 
Posts: 5
Joined: Tue Mar 30, 2010 10:10 am

Re: WindowTester not able to click combo item in property sh

Postby keertip » Mon Oct 11, 2010 8:48 am

What do you see when you run the test? Does it click on the Combo? Does the drop down appear?
keertip
Moderator
 
Posts: 221
Joined: Thu Mar 15, 2007 10:26 am

Re: WindowTester not able to click combo item in property sh

Postby har_shan » Tue Oct 26, 2010 5:14 am

thanks for reply and sorry for delay (didn't get any notification, so thought no one replied).
yes, drop down appears and is on focus but somehow the code that should click it is not clicking it
and just exits saying 'WidgetNotFoundException'

(and am trying this in latest version 6.0.0)

let me know if you need more info
har_shan
 
Posts: 5
Joined: Tue Mar 30, 2010 10:10 am

Re: WindowTester not able to click combo item in property sh

Postby keertip » Tue Oct 26, 2010 8:27 pm

Do you have sample code that we could use to reproduce the issue at our end?
keertip
Moderator
 
Posts: 221
Joined: Thu Mar 15, 2007 10:26 am

Re: WindowTester not able to click combo item in property sh

Postby har_shan » Wed Oct 27, 2010 10:28 am

actually windowtester seems to work fine for certain combos but not for others. i will extract out and provide you the sample to simulate this.
thanks
har_shan
 
Posts: 5
Joined: Tue Mar 30, 2010 10:10 am


Return to Window Tester

Who is online

Users browsing this forum: No registered users and 1 guest

cron