I need to click OK on a javascript warning message as soon as a web
page loads, but I'm having problems accessing the popup. Here's my
code:
$browser.goto(url)
# popup appears here. script hangs
hwnd = $browser.enabled_popup(30)
if (hwnd)
popup = WinClicker.new
popup.makeWindowActive(hwnd)
popup.clickWindowsButton("Windows Internet Explorer", "OK", 30)
end
When I manually step through my test in irb, the command prompt never
returns after I issue browser.goto. This leads me to believe I need to
start looking for the popup before $browser.goto(url), but I don't
know how. The same popup handling code works for me in other parts of
the application when I download a file or confirm a delete. In those
cases,however, I click a button with click_no_wait to trigger the
popup.
I appreciate any advice.
Mike
My problem is that when I load the page, the popup displays. The
script halts and waits for the popup to clear, which produces a "hung"
script. I needed the goto_no_wait method, but that's missing from the
current version of Watir - I think (attempt at humor, laugh). The
answer is to use AutoIt in a new thread to watch for popups. The code
is in the FAQ and works as-is. I just missed it the first dozen times.
Regards,
Mike