I've used AutoIT to some degree, especially with Windows OS dialogs such as the Print dialog. Did not realize it was installed with Watir, that must have been a recent change.
Snippet:
# Windows OS system dialogs (print, save, open file, etc...)
SYSTEM_DLG = "[Class:#32770]"
OPEN = "Open"
CANCEL = "Cancel"
SYSTEM_DLG = "[Class:#32770]"
OPEN = "Open"
CANCEL = "Cancel"
$autoit = WIN32OLE.new('AutoItx3.Control')
def WBE_Windows_System_Print(action = "")
# wait up to 5 seconds for print dialog to appear
# wait up to 5 seconds for print dialog to appear
$autoit.WinWaitActive(SYSTEM_DLG, "", 5)
if (action == CANCEL)
$autoit.ControlClick(SYSTEM_DLG,"",CANCEL)
print "I hit cancel button"
else
$autoit.Send("{ENTER}")
print "I hit enter...now you manually retrieve printout"
end
end
if (action == CANCEL)
$autoit.ControlClick(SYSTEM_DLG,"",CANCEL)
print "I hit cancel button"
else
$autoit.Send("{ENTER}")
print "I hit enter...now you manually retrieve printout"
end
end
I found I was having issue with clicking on the final print button in the system dialog, so I just sent an Enter key, which defaults to hitting print in Windows.
Hope this helps,
Mark Hagen
Automation QA Engineer
14455 N. Hayden Road
Scottsdale, AZ 85260
Mobile: 630-533-5501

I am an employee of Go Daddy. The views expressed on this discussion board are mine
alone and do not necessarily reflect the views of Go Daddy.com, Inc. or its
affiliates.
alone and do not necessarily reflect the views of Go Daddy.com, Inc. or its
affiliates.
-------- Original Message --------
Subject: Re: [Wtr-development] AutoIt?
From: Željko_Filipin <[email protected]>
Date: Fri, November 04, 2011 1:22 am
To: Watir development <[email protected]>
On Fri, Nov 4, 2011 at 4:48 AM, Bret Pettichord <[email protected]> wrote:
> Is this still an accurage description of how we handle pop up windows?
> http://wiki.openqa.org/display/WTR/Pop+Ups
I think popup support has the worst documentation in Watir project. I plan to write about popups in the book, but it is not high on my list. One of the reasons that it is low on the list is that I never had to work with them, so I have almost no experience.Željko
_______________________________________________
Wtr-development mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/wtr-development
_______________________________________________ Wtr-development mailing list [email protected] http://rubyforge.org/mailman/listinfo/wtr-development
