Hi, Paul:
Thanks for your help. There is a text field which I can set the date.
Lixin
Paul Carvalho <[EMAIL PROTECTED]> wrote:
Paul Carvalho <[EMAIL PROTECTED]> wrote:
Hi there. I am a different Paul. While I can't offer any additional help on your first problem, I do have a few suggestions for your second question.
Unless I am misreading the code below, it looks like there is a text input field right beside the calendar.png icon. In our web app we have similar places where the user can click on these calendar icons when prompted to enter a date. When I am scripting I just ignore the calendar popups - too much effort required for very little gain.
Why don't you just type the date you want into the text field next to the calendar icon? Taking a guess from the HTML below, I would expect the following to work:
ie.text_field( :id, "consents_530" ).set( '12/31/2005' ) # the code hints at the format: "%m/%d/%Y"
If you are set on scripting the pop-up calendar control, how does SpySmith recognise the object? In our app, the pop-up calendar appears as new table within the Frame, not as a separate (_javascript_ or IE) window, so I just reference the new table's ID tag. I played around with navigating our calendar control using Watir but it seemed to be a waste of time. It takes me one line to enter a date into the input field and continue, while it could take me over a dozen lines to do the same thing using the popup calendar control.
Bells and whistles, man. Just ignore them if you can work around them. =)
Good luck. Paul.
On 13/04/06, gege qian < [EMAIL PROTECTED]> wrote:
2)
In our application , we have a calendar image, which user can click on for selecting
the date. I do not know if there is a way to a)pop up the calendar, b)and select the date.
the html source code is as follows:
<table class="header_info"><tr valign="top"><td ><label> *Date consented</label><br />
<input class="date" id="consents_530" name="consents[530][date_consent_signed]" size=12 type="text" />
<br />
</td>
<td ><br />
<img alt=Calendar class=date id=consents_530_b src="" title="Show calendar"/>
<script type="text/_javascript_">
Calendar.setup({ inputField:"consents_530", button:"consents_530_b", cache:true, ifFormat:"%m/%d/%Y", firstDay:0, range:[1956,2008], showOthers:true, step:1 })
</script>
</td>
</tr>
</table>
_______________________________________________
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general
Yahoo! Messenger with Voice. PC-to-Phone calls for ridiculously low rates.
_______________________________________________ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general