def get_new_win()
        # get a handle if one exists
        aa = Win32API.new("user32", "GetForegroundWindow",[] , 'L')
        hwnd = aa.call
        if (hwnd)  # yes there is a popup
            return Watir::IE.attach(:hwnd, hwnd)
        else
            return nil
        end
    end

ie1=Watir::IE.start(url)
ie1.button().click
if ie2=get_new_win()
    ie2.button().click
    ie2.close
end


Wesley
Man should be hard to himself, but tolerant to others.

--~--~---------~--~----~------------~-------~--~----~
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