Its not my code that is throwing the error. Here is the code for
enabled popup from my watir install. The line generating the error is
hwnd_modal, arr = GetWindow.call(hwnd, GW_ENABLEDPOPUP) - hwnd is
undefined.

module Watir
  module PageContainer
    include Win32
    def enabled_popup(timeout=4)
      # Use handle of our parent window to see if we have any
currently
      # enabled popup.
      hwnd_modal = 0
      Waiter.wait_until(timeout) do
        hwnd_modal, arr = GetWindow.call(hwnd, GW_ENABLEDPOPUP)
        hwnd_modal > 0
      end
      # use hwnd() method to find the IE or Container hwnd (overriden
by IE)
      if hwnd_modal == hwnd() || 0 == hwnd_modal
        hwnd_modal = nil
      end
      hwnd_modal
    end
  end
end

On Mar 3, 1:49 pm, Jim Matthews <[email protected]> wrote:
> I thought you were having the same problem I am with popups, but I
> think yours is different at this point.
>
> The window handle is going to be on the browser and not a part of the
> DOM.
>
> You have to get the hwnd off the browser and go from there.
>
> Jim
>
> On Mar 3, 1:16 pm, [email protected] wrote:
>
>
>
> > Trying to execute enabled_popup and it is throwing an exception
>
> >  undefined local variable or method `hwnd' for #<Watir::Frame:
> > 0x3d7b4d4>
>
> > I checked the source for enabled_popup and it does seem to have an
> > undeclared variable. Is this working for other people. Working on
> > latest version of watir.- 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