Created
June 30, 2015 18:00
-
-
Save acdcjunior/123423d40717efa667a3 to your computer and use it in GitHub Desktop.
Selenium Automatic File download using Firefox
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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