When using Watin, you can click on a link automatically or goto a download URL and save a file automatically using something similar to:
FileDownloadHandler fileDownloadHandler = new FileDownloadHandler(featureCode2AnnouncementWavPath);browser.AddDialogHandler("file.zip");
browser.GoTo("http://www.mydomain.com/file.zip"); // OR: browser.Link(Find.ByID("download_button")).Click();
But IE will give you typically a notification bar warning of the type :
"IE has blocked site from downloading files to my computer" and then Watin will not download the file.
The only solution for IE8 that I found for this is to edit the registry and disable this prompting:
HKEY_LOCAL_MACHINE (or HKEY_CURRENT_USER)
iexplore.exe = 0x00000000
currently, i manage to save a file using this method, but for some reason the code stops after clicking the save button and then times out with an exception:
"Timeout while Internet Explorer state not complete"
I will update if i ever manage to solve this issue (it currently went down in priority)