[Wtr-general] Asking two questions related on javascript pop up window

gege qian gegeqian at yahoo.com
Thu Apr 13 10:27:13 EDT 2006


Hi Paul   
   
  I'm new to watir and ruby. I have two questions to ask
  1) i read the post on http://rubyforge.org/pipermail/wtr-general/2005-April/001427.html. I tried the way paul suggested, but never succeed.
   
  here is the code
   
  require 'watir/WindowHelper'
require 'watir'
require 'toolkit/onc_login'
require 'toolkit/onc_logout'
require 'toolkit/javascriptHd'
  login
  $ie.link(:text, "Search for Protocol").click
  $ie.textField(:id, "str").set("J0260")
  $ie.button(:name, "search").click
  listTable = $ie.table(:id, "enroll_list")
  # here, there are some hidden field, maybe that's why the number of rows is 22
$ie.checkbox(:index, 5).set
$ie.button(:value, "Consent").click
  startClicker("OK", 3)
$ie.button("Submit").click
  
helper = WindowHelper.new
helper.push_confirm_button_ok()
  The button on the pop up window was never clicked
  would you mind giving me some feedback on this
   
  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=/images/calendar.png 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>

   
  Thanks a lot
  gege

		
---------------------------------
Blab-away for as little as 1¢/min. Make  PC-to-Phone Calls using Yahoo! Messenger with Voice.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060413/706301fc/attachment.html 


More information about the Wtr-general mailing list