Skip to content

Instantly share code, notes, and snippets.

@acdcjunior
Created June 30, 2015 18:00
Show Gist options
  • Save acdcjunior/123423d40717efa667a3 to your computer and use it in GitHub Desktop.
Save acdcjunior/123423d40717efa667a3 to your computer and use it in GitHub Desktop.
Selenium Automatic File download using Firefox
FirefoxProfile fxProfile = new FirefoxProfile();
fxProfile.setPreference("browser.download.folderList",2);
fxProfile.setPreference("browser.download.manager.showWhenStarting",false);
fxProfile.setPreference("browser.download.dir","c:\\mydownloads");
fxProfile.setPreference("browser.helperApps.neverAsk.saveToDisk","text/csv");
WebDriver driver = new FirefoxDriver(fxProfile);
driver.navigate().to("http://www.foo.com/bah.csv");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment