Hello Everyone,
I have been trying to handle File Download pops in FF browser. I had
posted a similar question in the FireWatir group (http://
+Firefox#903516a40a227883), But I thought it would be better here, as
I am actually using Watir.
My script works successfully until the popup is shown, but does
nothing after that. The code is very similar to the one that I use for
require 'watir'
require 'win32ole'


def save_file(filename)
    filepath = "c:\\#{File.basename(filename, '.rb')}"
     ai = WIN32OLE.new("AutoItX3.Control")
    window_title = ai.WinGetTitle("[active]") # This is to get the
title of the popup. Since this changes in FF, for every file download.
    sleep 1
    ai.ControlFocus(window_title, "", "&OK")
    sleep 1
    ai.ControlClick(window_title, "", "&OK")
    sleep 1
    ai.ControlSend("Enter name of file to save to...", "",
    sleep 1
    ai.ControlClick("Enter name of file to save to...", "", "&Save")

    window_title1 = "Enter name of file to save to..."
    ai.ControlFocus(window_title1, "", "&Yes")
    sleep 1
    ai.ControlClick(window_title1, "", "&Yes")

sleep 2
$browser.link(:text, "zzz.zip").click
sleep 5
The popup remains and nothing happens. The scripts finishes running
without any errors.
But the same code works great with IE. Can someone help in pointing
the problem here?

Also how to control Radio buttons using AutoIt (for the same file
download popup).
Thank you very much.

You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
To unsubscribe from this group, send email to 
For more options, visit this group at 

Reply via email to