I'm using selenium webdriver to do some downloading using firefox. At the moment my script waits for a specific time after download has inititated and then close the firefox. I want to know if there is a way to configure firefox to automatically close on download completions? Or using selenium webdriver, can I check if download has been completed? I don't want to use any add on, as it might add dependency in my script. I cant use wget/curl etc to download the files. Thanks in advance
What Ignacio Contreras said. Polling the download path is possibly the best (most robust) solution.
Alternative #1:
Use a FirefoxProfile
with Download Statusbar addon. It has a handy option to "Continue downloading in Download manager after window has been closed" (or something very similar), so that it will keep Firefox running in the background until the download has been finished.
Alternative #2:
Download the file directly using this (or any other similar WebDriver-friendly tool) ... or this, if you can. That will totally cut Firefox out of the process.