Spike, you beat my post by mere minutes; as it seems I'm having
exactly the same issue as you.

After much searching on the group and other sources, I had two
different approaches to this (below); one using WinClicker, the other
using calls to AutoIt.  Both methods worked *sometimes* yesterday,
neither work today by just not seeing the presence of the confirmation/
alert box.  To add to the mix; no matter what I did when I did get it
working, I could never configure the scripts in a way for 'Cancel' to
be selected instead of 'OK'.

So if anyone out there has any reliable way of selecting 'OK' or
'Cancel' on an IE confirmation/alert box, I'll be very grateful.  As
I'm pulling my hair out, and there really isn't much left there to
pull.

Many thanks,


GJHmf


- - - - - - - -

# WinClicker method

def test_Delete
    browser.button(:xpath, "//i...@alt='delete']").click

    hwnd = browser.enabled_popup(10)
    if (hwnd)
        w = WinClicker.new
        w.makeWindowActive(hwnd)
        w.clickWindowsButton_hwnd(hwnd, "OK")
    end
end

- - - - - - - -

# AutoIt method

require 'watir/ie'
require 'watir/contrib/enabled_popup'

def test_Delete
    browser.button(:xpath, "//i...@alt='delete']").click

    th = Thread.new { system("rubyw clickConfirmOK.rb") }
    sleep(2)
    Thread.kill(th)
end

- - - - - - - -

# clickConfirmOK.rb

require 'watir/WindowHelper'
$helper = WindowHelper.new
$helper.push_confirm_button_ok()

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