Hello Everyone, Can someone help me with this issue please. I need this working very desperately for my project. Thank you very much.
Margam On Dec 15, 2:40 pm, Margam <nk.mar...@gmail.com> wrote: > 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:// > groups.google.com/group/firewatir/browse_thread/thread/ > 645846692f7d64fd?ie=utf-8&oe=utf-8&q=watir+-+file+download+in > +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 > IE. > ------------------ > require 'watir' > require 'win32ole' > > Watir::Browser.default='firefox' > $browser=Watir::Browser.new > > def save_file(filename) > filepath = "c:\\#{File.basename(filename, '.rb')}" > sleep(10) > 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...", "", > "Edit",filepath) > 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") > end > > $browser.goto("http://abcd.com") > sleep 2 > $browser.link(:text, "zzz.zip").click > sleep 5 > save_file("zzz") > -------------------------- > 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. > > Margam --~--~---------~--~----~------------~-------~--~----~ 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: http://wiki.openqa.org/display/WTR/Support To unsubscribe from this group, send email to watir-general-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/watir-general -~----------~----~----~----~------~----~------~--~---