I am using Selenium for automation (C#, selenium 3.3.4, gecko driver 0.16.0, on Win 7 64 Bit, driven by Powershell)
I have set the Firefox profile to automatically download files to a specific folder:
$profile.SetPreference("browser.download.dir", $downloadPath)
$profile.setPreference("browser.download.folderList", 2);
$profile.setPreference("browser.helperApps.neverAsk.saveToDisk", "text/csv,application/csv,application/octet-stream,text/plain");
When I set the browser URL to the download link, the download happens immediately, but then the script stalls for almost exactly one minute every time afterwards. The URL in the address bar stays the same, I suspect that this causes the wait in the first place (a wait for the page to load).
When opening the next URL after the 1 minute wait the delay is not over though. Then a few of the 1 minute cycles seem to be necessary before the browser accepts the new url and opens it. It seems like hitting the first timeout causes things to go awry.
I have tried setting the implicit wait to 20 seconds, but that didn't seem to have an effect and I have thus removed it again. How to make all this go more smoothly?
Here is my attempt at setting the implicit wait:
$timespan = [System.TimeSpan]::FromSeconds(20)
$firefox.manage().timeouts().implicitlyWait($timespan) | out-null