Using Selenium with the new Telerik Date Controls

2 posts, 0 answers
  1. Rupa
    Rupa avatar
    1 posts
    Member since:
    Jul 2012

    Posted 26 Jul 2012 Link to this post


    I am the only QA tester in my company, and also in charge of creating automated tests.  Since we're a small company, we're cutting costs as much as we can, without compromising quality, ease of work, productivity, etc.  Which is why we use the free open source Selenium automated test scripting, since it's free compared with the thousands we would have to pay for Telerik automated testing package and training.  

    Anyways, I used to use the old Telerik date controls for Selenium automated tests where the date in dd/mm/yyyy format (this is in the UK) would be typed in by the Selenium scripts.  And when the Next button was clicked, the data was processed and the next page would appear and the scripts would continue working.  However, with the new Telerik date control, even when the Selenium scripts enter a proper dd/mm/yyyy date and then the Next button is clicked, the date fields become blank and error messages like, "Please enter date" appear, and the scripts fail.  Why is this happening?  The old Telerik controls worked just fine with the automated Selenium scripts where you just type in a date in dd/mm/yyyy format.  Why is this not working now?  Any ideas?  Anyone struggling with this?  There are a few date fields we use in our system, and so it would be rather tedious to type in dates manually every single time when scripts fail, I make them pause, quickly enter the dates, and resume automated testing.  Please advise me when convenient.  Thanks a lot!  
  2. Martin
    Martin avatar
    833 posts

    Posted 31 Jul 2012 Link to this post

    Hello Rupa,

    Note that by design RadInput controls set their value after they are blurred. Based on that I suspect that the problem is caused by the fact that the post back occurs fast enough so that the control does not mannage to set its value on time. The easiest resolution is to ensure that the input is blurred before the post back is triggered. For example you can explicitly focus another control and then trigger the postback.

    I hope this helps.

    All the best,
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Back to Top