Last active
August 20, 2020 12:06
-
-
Save angelovstanton/ce3476263a6551aa4dd1b839d83e0249 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
ProfilesIni profile = new ProfilesIni(); | |
FirefoxProfile firefoxProfile = profile.getProfile("xyzProfile"); | |
String downloadFilepath = "c:\\temp"; | |
firefoxProfile.setPreference("browser.download.folderList", 2); | |
firefoxProfile.setPreference("browser.download.dir", downloadFilepath); | |
firefoxProfile.setPreference("browser.download.manager.alertOnEXEOpen", false); | |
firefoxProfile.setPreference("browser.helperApps.neverAsk.saveToDisk", | |
"application/msword, application/binary, application/ris, text/csv, image/png, application/pdf, text/html, text/plain, application/zip, application/x-zip, application/x-zip-compressed, application/download, application/octet-stream")); | |
FirefoxOptions firefoxOptions = new FirefoxOptions(); | |
firefoxOptions.setProfile(firefoxProfile); | |
WebDriver firefoxDriver = new FirefoxDriver(firefoxOptions); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment