0

I'm wondering how to select a calendar date from a page using Watir Webdriver.

The URL I'm testing is: http://dev01-new.firestonecompleteautocare.com/appointment/schedule-appointment.htm?execution=e2s4

You have to get to the third step in order to select a calendar date.

I attempted various ways of selecting a calendar including executing the script, but nothing seems to work.

browser.execute_script("DP_jQuery_1360620655913.datepicker._selectDay('#choice1\\-date',1,2013, this);return false;")

Any help is much appreciated.

  • 1
    Do you have a script that gets to the 3rd step? It is a lot easier to help if we can reproduce the problem. Also explaining what you tried and the result would ensure we do not duplicate your efforts. For example, did you try clicking the link or the table cell? Seems odd that your first approach would be to use execute_script. – Justin Ko Feb 12 '13 at 04:07

1 Answers1

0

There's an onclick attribute for the table cell that displays the date:

<td onclick="DP_jQuery_1360625373055.datepicker._selectDay('#choice1\\-date',1,2013, this);return false;" class=" "><a href="#" class="ui-state-default">13</a></td>

You should be able to use the fire_event method in this scenario. Example:

browser.link(:id => "foo").fire_event "onclick"
orde
  • 5,233
  • 6
  • 31
  • 33