I\'m using Chrome Web Driver 2.10 chromedriver_win32.zip with Selenium WebDriver 2.31.2.
With verbose logging enabled it seems the DesiredCapabilities
This worked greatly for me:
DesiredCapabilities cap = DesiredCapabilities.firefox();
FirefoxProfile fprofile= new FirefoxProfile();
fprofile.setPreference("browser.download.folderList",2); //0-desktop,1-file download folder,2-specified location
fprofile.setPreference("browser.download.manager.showWhenStarting", false); //prevent download file window
fprofile.setPreference("browser.download.dir","E:\\Downloadfilebyprogram");
fprofile.setPreference("browser.download.manager.focusWhenStarting", false);
//fprofile.setPreference("browser.helperApps.alwaysAsk.force", false);
//fprofile.setPreference("browser.download.manager.closeWhenDone", true);
//fprofile.setPreference("browser.download.manager.useWindow", false);
//fprofile.setPreference("services.sync.prefs.sync.browser.download.manager.showWhenStarting", false);
//fprofile.setPreference("browser.helperApps.neverAsk.openFile,","application/vnd.ms-excel");
fprofile.setPreference("browser.helperApps.neverAsk.saveToDisk","application/vnd.ms-excel");
fprofile.setPreference("browser.download.manager.alertOnExeOpen", false); //prevent from opening a file
cap.setCapability(FirefoxDriver.PROFILE, fprofile);
WebDriver driver=new FirefoxDriver(cap);