Any Support for DateTime Widget?

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

Any Support for DateTime Widget?

Postby goksel » Tue Jan 18, 2011 6:43 am

Hello,

I am trying to record the action of selecting a date (e.g. 18.01.2011) by means of clicking on the day buttons on a org.eclipse.swt.widgets.DateTime widget with style SWT.CALENDAR.

To support the recorder to generate readable code I named the widget with .setData(key,value). The resulting code is unfortunately not useful because just the widget is clicked and not its "sub widgets", i.e. the date buttons.
Code: Select all
      
ui.click(new NamedWidgetLocator("NAME_WORK_SCHEDULE_VIEW_BTN_DATE"));
ui.wait(new ShellShowingCondition("Kalender"));
ui.click(new NamedWidgetLocator("NAME_WORK_SCHEDULE_VIEW_DT_CALENDAR"));
ui.click(new NamedWidgetLocator("NAME_WORK_SCHEDULE_VIEW_DT_CALENDAR"));
ui.click(new NamedWidgetLocator("NAME_WORK_SCHEDULE_VIEW_DATE_CLIENT_BTN_OK"));

How much support is there for such a widget by WT and how can I get this work?

Thanks,
Göksel
Attachments
Bild 7.png
Bild 7.png (8.79 KiB) Viewed 106 times
goksel
 
Posts: 17
Joined: Thu Nov 25, 2010 7:13 am

Re: Any Support for DateTime Widget?

Postby keertip » Wed Jan 19, 2011 10:14 am

Sorry, do have any built in support for the DateTime widget. Is there a way to select the date other than by click on the number? If so maybe that would work.
keertip
Moderator
 
Posts: 221
Joined: Thu Mar 15, 2007 10:26 am

Re: Any Support for DateTime Widget?

Postby goksel » Thu Jan 20, 2011 1:58 am

keertip,
thanks for your reply. After having selected the date via the DateTime widget the result is also entered into a read-only text field of type Text. As I have named that field with .setData I can locate this widget. I wrote two small helper methods to get and set the date. So this is not the way a user would select a date but with this workaround I am able to test.
Cheers,
Göksel
goksel
 
Posts: 17
Joined: Thu Nov 25, 2010 7:13 am

Re: Any Support for DateTime Widget?

Postby keertip » Thu Jan 20, 2011 10:50 am

Yes, not the best way, but glad that you could find a workaround!
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

cron