Selenium - Problem testing a date field
I have a page that has an image which when clicked shows a calendar. I've put an example of it here --> http://www.dotvibes.com/test/test.html Clicking on the image shows a calendar.
I tried to use Selenium IDE to record the action of clicking this image but it just does not work properly.
Here is what selenium IDE returns
<tr>
click
<td>//img[@name='calendarButton' and @onclick="return showCalendar('date_ceased0', 'dd/MM/yyyy');"]</td>
`
After clicking the image, selenium 开发者_如何转开发IDE does not record actual clicking of a date in the calendar. And also i cant type anything directly into the text box because for some reason it ends up being "undefined".
What do i need to do to test the image click, selecting a date including a different month? Please have a look at the example page shown above and try and record selecting a date using the IDE.
Thanks
Selenium IDE doesn't record every action, so sometimes you need to play around with the commands available. The following works for me for selecting a date in your example:
click | name=calendarButton
mouseDown | css=tr.headrow td:nth-child(4)
waitForVisible | css=.combo .label:contains(Jan)
mouseOver | css=.combo .label:contains(Aug)
mouseUp | css=.combo .label:contains(Aug)
waitForNotVisible | css=.combo .label:contains(Jan)
mouseOver | css=.day:contains(10)
clickAt | css=.day:contains(10)
clickAt | css=.day:contains(10)
verifyValue | id=provisionDateP | 10/08/2010
精彩评论