Hi Joakim, I believe the reason why the Calendar pops up when you try to enter a date to the DatePicker is because of the fact that it has a ValueChangeHandler added to it that fires when the a new date is entered. A potential solution would be to create your own subclass of the ValueChangeHandler that mimics that signature the DatePicker.addValueChangeHandler(ValueChangeHandler<Date> handler) expects, but make it do nothing when the value is changed. Also, because the default ValueChangeHandler responsible for bringing up the calendar has been previously added, you can take advantage of the fact that the addValueChangeHandler() method returns a handle to the HandlerRegistration object belonging to the DatePicker and removing that handler before you run your test.
If that doesn't work, you might consider mocking out the DatePicker for the test you're trying to run. I'm only passingly familiar with WebDriver, but I believe there are mock utilities available there that could help mock the widget out so you can interact with it and get exactly the date you need in your test. If not, you could always create your own subclass of the DatePicker to mock it out for your test case. Hope that helps, -Sumit Chandel 2009/7/28 Joakim Sjöberg <[email protected]> > Hello! > > > > I have run across a problem using WebDriver for automatic testing of our > GWT application. > > On certain fields we are using the GWT DatePicker, and now when I am auto > scripting in WebDriver > > I can´t add a date to that field since its keep popping up a Calendar. Is > there anyone who have any > hints on how to solve or get past this problem? > > > > Regards > > > > *Artificial Solutions Scandinavia AB* > > *Joakim Sjöberg > Developer* > > > > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/Google-Web-Toolkit?hl=en -~----------~----~----~----~------~----~------~--~---
