[Wtr-general] Javascript Alert windows
Cain, Mark
Mark_Cain at RL.gov
Wed Oct 4 15:48:55 EDT 2006
Try this:
require 'watir\contrib\enabled_popup'
<Your code>
# use click_no_wait to click the button that invokes the JS Alert
$ie.button.click_no_wait
hwnd = ie.enabled_popup(5) # get a handle if one exists
if (hwnd) # yes there is a popup
w = WinClicker.new
w.makeWindowActive(hwnd)
# "OK" or whatever the name on the button is
w.clickWindowsButton_hwnd(hwnd, "OK")
end
--Mark
________________________________________
From: wtr-general-bounces at rubyforge.org
[mailto:wtr-general-bounces at rubyforge.org] On Behalf Of David Munns
Sent: Wednesday, October 04, 2006 10:19 AM
To: wtr-general at rubyforge.org
Subject: [Wtr-general] Javascript Alert windows
Does Watir have a way of processing Javascript Alert windows, by
clicking the OK button to dismiss the window? The code that invokes the
window issues an alert call with no window handle. I did not find
anything on this in the online docs or in the email dist.
More information about the Wtr-general
mailing list