You need use Firefox profiling to overcome from this issue:-
FirefoxProfile pro=new FirefoxProfile();
pro.setPreference("browser.downLoad.folderList", 0);
pro.setPreference("browser.helperApps.neverAsk.saveToDisk", "Applications/zip");
WebDriver driver=new FirefoxDriver(pro);
browser.download.folderList controls the default folder to download a
file to. 0 indicates the Desktop; 1 indicates the systems default
downloads location; 2 indicates a custom folder.
browser.download.dir holds the custom destination folder for
downloading. It is activated if browser.download.folderList has been
set to 2.
browser.helperApps.neverAsk.saveToDisk stores a comma-separated list
of MIME types to save to disk without asking what to use to open the
file.
Below code for chrome multiple download option:-
ChromeOptions options = new ChromeOptions();
Map<String, Object> prefs = new HashMap<String, Object>();
prefs.put("profile.default_content_settings.popups", 0);
prefs.put("download.default_directory", getClass().getResource("/data/input").toString().replace("%20", " ").replace("file:","").replaceFirst("/", ""));
options.setExperimentalOption("prefs", prefs);
options.addArguments("--test-type");
capabilities.setCapability(ChromeOptions.CAPABILITY, options);
For IE Refer :-
http://9to5it.com/internet-explorer-disable-do-you-want-to-open-or-save-this-file-prompt/
You can also use Robot class of java but it can lock your screen for while
You need to use ROBOT class for firing an ENTER Action event. In java if you want to fire any event you have to use Robot class for typing using programatically or firing events like ENTER and ESCAPE.
// Create object of Robot class
Robot object=new Robot();
// Press Enter
object.keyPress(KeyEvent.VK_ENTER);
// Release Enter
object.keyRelease(KeyEvent.VK_ENTER);
Hope it will help you :)
Please get back to me if still facing issue :)