We use Selenium to check file downloads from our web application. We currently use Firefox, install it in the desired download directory, and make sure that pop-ups are not displayed and that user interaction is not required when downloading files.
For FirefoxDriver, we do this:
File downloadDir = ...; FirefoxProfile profile = new FirefoxProfile(); profile.setPreference("browser.download.dir", downloadDir.getAbsolutePath()); profile.setPreference("browser.download.folderList", 2); profile.setPreference("browser.helperApps.neverAsk.saveToDisk", "..."); WebDriver driver = new FirefoxDriver(profile);
What to do for InternetExplorerDriver to achieve the same effect? I could not find InternetExplorerProfile or the switch in DesiredCapabilities.
DesiredCapabilities capabilities = new DesiredCapabilities(); capabilities.setCapability("???", "???"); WebDriver driver = new InternetExplorerDriver(capabilities);
source share