We seem to do just this. I haven't looked at it in awhile so I'm not sure if
this is everything. This is in a module.

  require 'watir\ie'
  require 'watir\contrib\enabled_popup'

  # Main method to click a modal dialog button.
  def click_modal_button(ie, type='OK', sleep_time=6, timeout=20)
    hwnd = ie.enabled_popup(sleep_time)
    if (hwnd)
      w = WinClicker.new
      w.clickWindowsButton_hwnd( hwnd, "#{type}")
      w=nil
    end
  end



On Wed, Apr 8, 2009 at 6:26 AM, spike <vinaykumarl...@gmail.com> wrote:

>
> Hi
>
> I'm woking on windows platform and IE7 using "WATIR" I've used the
> following code for handling "JavaScript" popup
>
> require 'win32ole'
> wsh WIN32OLE.new('Wscript.Shell')
>  wsh.AppActivate('Windows Internet Explorer')
>  wsh.Sendkeys('{ENTER}')
>
> but its not working i'm getting the following error.
>  1) Error:
> test_manage_resources(Manageresources):
> NoMethodError: undefined method `wsh' for #<Manageresources:0x2b8c4bc>
>    manageresource.rb:24:in `test_manage_resources'
>
> Please Please please... give a solution to my problem i'm stuck with
> handling popup from past 2 days..
>
> thankingyou
>
> >
>


-- 
Lisa Crispin
Co-author with Janet Gregory, _Agile Testing: A Practical Guide for Testers
and Agile Teams_ (Addison-Wesley 2009)
http://lisacrispin.com

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~----------~----~----~----~------~----~------~--~---

Reply via email to