I am trying to implement a download file functionality for my web application using webdriver. In chrome or firefox, we can set the capability to download the files to a defined location upon clicking download button without any window prompt.
But in IE 9, I don't find any capability setting for download options.
Also after clicking on download button in IE, webdriver is hanging after window prompt for save/open/cancel. Webdriver doesn't return anything after click operation. I had to quit webdriver and re-create the webdriver object to proceed with next step.
To handle the window prompt, I tried using Sikuli/send key methods etc. All these works only when the window is in focus. It doesn't work when I run the script having machine locked or run through remote like via Jenkins.
How can I configure IE no to prompt save option but download file to any predefined path. Like in IE8, we can set the regedit to set download path.
To download any file in IE - Browser, it better idea to use the cookies to get it done. Please use cookies rather than spending worthless time finding other way.
Selenium throws
Modal dialog Present
exception if file download popup present. Some times webdriver hangs out based on operations perform on the browser after popup present.You can do it manually through registry if you want: http://9to5it.com/internet-explorer-disable-do-you-want-to-open-or-save-this-file-prompt/
If you are using Java as coding language, you can use
Robot
class. Please refer below link for example. How to download .docx file using Selenium webdriver in Java?There is no class in
c#
asRobot
class inJava
. I am using AutoIT to handle windows popups.Hope this helps.