Watin + Calendar选择一个有效日期

时间:2016-07-09 16:48:34

标签: javascript c# calendar automated-tests watin

我有以下代码用于只读文本字段和下拉列表:

   <div class='formRowNB'>
   <label class="label" for="appointment_date">Date of Appointment
   <abbr title='required'>*</abbr>
   </label><li class="yatri_date input required stringish" id="appointment_date_input">
   <input icon="calendar.gif" id="appointment_date" name="appointments[appointment][date]" readonly="readonly" type="text" />
   <a href="#select">
   <img alt="Calendar" class="calendar_icon" src="/assets/calendar-245ca30eba63389ab5b95465008952fb.gif" /></a>
   </li>
   </div>
   <div class='formRowNB hide' id='non-business-day-message'> You've selected a non-business day.
    </div>
    <div class='formRowNB'>
    <label class="label" for="appointment_time">Time of Appointment
    <abbr title='required'>*</abbr>
    </label><li class="select input required" id="appointment_time_input">
    <select id="appointment_time" name="appointments[appointment][time]"><option value=""></option>    </select>
   </li>
   </div>

这是我的watin代码,用于点击日历并指定日期(基于定义的格式)

        browser.Image(Find.ByClass("calendar_icon")).Click();
        browser.TextField(Find.ByName("appointments[appointment][date]")).Value= "2016-08-01";

但不会根据所选日期触发下拉列表。有什么想法吗?

0 个答案:

没有答案