Мы используем Selenium для тестирования загрузки файлов из нашего веб-приложения. В настоящее время мы используем Firefox, установите его в желаемый каталог загрузки и убедитесь, что при загрузке файлов не появляются всплывающие диалоговые окна и не требуется взаимодействие с пользователем.
Для FirefoxDriver мы делаем это:
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);
Что сделать, чтобы InternetExplorerDriver добился такого же эффекта? Я не смог найти ни InternetExplorerProfile, ни переключатель в DesiredCapabilities.
DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.setCapability("???", "???");
WebDriver driver = new InternetExplorerDriver(capabilities);