Driving RadDatePicker from an automated test

4 posts, 0 answers
  1. John
    John avatar
    2 posts
    Member since:
    Oct 2011

    Posted 10 Oct 2011 Link to this post


    I'm trying to write an automated test to drive an ASP.NET web app that includes a RadDatePicker control.  I don't really need to drive the date-selection pop-up - I'd be happy with being able to enter the date into the input field.  However, although I can "type" the text into the input field, it would appear that the date isn't really being set in the control, and nothing is being posted back to the server.

    I wondered if there was a "trick" I needed to use (like there is for selection from a combo box for example: http://www.telerik.com/community/forums/aspnet/combobox/select-value-in-telerik-combo-box.aspx)

    I'm using WatIn, although I imagine a Selenium user would have the same issue.

    Can you help?


  2. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 10 Oct 2011 Link to this post

    Hello John,

    You could set the EmptyMessage for showing the custom text also you can set the visibility of the DatePopUpButton.
    Here is the sample aspx:
    <telerik:RadDatePicker ID="RadDatePicker1" runat="server">
       <DateInput ID="DateInput1" InvalidStyleDuration="100" Skin="Office2007" runat="server" EmptyMessage="Select Date" >
       <DatePopupButton Visible="False" />

  3. DevCraft R3 2016 release webinar banner
  4. John
    John avatar
    2 posts
    Member since:
    Oct 2011

    Posted 10 Oct 2011 Link to this post

    Thanks for your suggestions, Princy.  However, it doesn't really solve my problem.  Perhaps it would help if I re-state the problem.

    • My acceptance test uses the WatIn framework
    • WatIn drives a browser to test a Web App that includes a Telerik RadDatePicker
    • WatIn can find the input date field by its ID:
    • WatIn can then enter a date in that field:
    • I can see that when WatIn does this, the expected date does appear to be "typed into" the browser, and the calendar control pops up below the input field.
    • WatIn then clicks my Submit button for me
    • The date is NOT posted to the server as part of the form, although other fields that WatIn has typed in for me are.

    From this I have inferred that when a real user drives the RadDatePicker control, perhaps some clever JavaScript stuff is happening.

    How do I get the clever stuff to happen? :-)
  5. David
    David avatar
    1 posts
    Member since:
    Jul 2013

    Posted 29 Oct 2013 Link to this post


    Try the following attributes which could work:
    <telerik:RadDatePicker .... DateInput-Enabled="true" EnableTyping="true" ... >

Back to Top