a little confusion here.

1. when you use click_no_wait, do you see a popup and if you do, your
code is not handing it, is that right? (reason i ask is because your
initial comment was you could not see the popup?)

2. in jsClick, you can remove the second parameter, since it is not
being used at all.

3. When you are calling jsClick the third parameter does not render in
ie or google, so not sure what you are passing in. Should be something
like 'OK', 'Cancel'. etc Once you fix that, it should handle your
popup

On Apr 15, 9:33 am, William <[email protected]> wrote:
> Here is the method i handle the popup menu,maybe you can give some
> advise.
>
> def jsClick( ie,a, button, user_input=nil)
>   waitTime=30
>  hwnd = ie.enabled_popup(waitTime)
>  puts hwnd
>   if (hwnd)
>     w = WinClicker.new
>    if ( user_input )
>      w.setTextValueForFileNameField(hwnd, "#{user_input}")
>    end
>    sleep 3
>     w.clickWindowsButton_hwnd(hwnd, "#{button}")
>     w=nil
>  end
> end
>
> def reboot(ie,unit_url,type)
>  ie.maximize()
>  ie.goto unit_url
>  ie.text_field(:name,"user").set "admin"
>  ie.text_field(:name,"pass").set "admin"
>  ie.button(:id,"login").click
>  case type
>  when 2 then
>  begin
>  ie.link(:url,unit_url+"/cgi-bin/config").click
>  end
>  when 5 then
>  begin
>  ie.link(:url,unit_url+"/config_tn.htm").click
>  end
>  end
>  sleep 3
>  ie.button(:id,"reboot").click_no_wait
>  puts "clicked"
>  #ie.button(:id,"reboot").click
>  jsClick(ie,@ie, "确定")
>  puts "The system("+unit_url+") is going to reboot..."
> end
>
> On Apr 15, 9:30 pm, William <[email protected]> wrote:
>
> > yes,if I use "click" it would popup,but if i use this method i that it
> > can not handle the javascript popup frame in my test.
>
> > On Apr 15, 9:01 pm, bwaybandit <[email protected]> wrote:
>
> > > Does the popup appear when you use just "click"?
>
> > > On Apr 15, 7:14 am, William <[email protected]> wrote:
>
> > > > The html is "<a name="reboot" id="reboot" class="myAreaLink"
> > > > onclick="cb_reboot();">
> > > >             Reboot</a>"
>
> > > > and i use " ie.button(:id,"reboot").click_no_wait" but the popup frame
> > > > can not come out.- Hide quoted text -
>
> > > - Show quoted text -- Hide quoted text -
>
> > - Show quoted text -
>
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To post to this group, send email to [email protected]
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~----------~----~----~----~------~----~------~--~---

Reply via email to