Register now or log in to join your professional community.
Hi, I am trying to disable Firefox download dialog through firefox profile so that it does not prompts for file download . Below is the code snippet : FirefoxProfile profile = new FirefoxProfile(); profile.setPreference("browser.download.folderList",2); profile.setPreference("browser.download.manager.showWhenStarting",false); profile.setPreference("browser.download.dir", "C:\\HM Download" ); profile.setPreference("browser.helperApps.neverAsk.saveToDisk", "application/pdf"); driver = new FirefoxDriver(profile); But it is not working. Download dialog still shows up Please provide me a genuine solution
Try below code
FirefoxProfile firefoxProfile = new FirefoxProfile(); firefoxProfile.setPreference("browser.download.folderList",2); firefoxProfile.setPreference("browser.download.manager.showWhenStarting",false); firefoxProfile.setPreference("browser.download.dir","c:\\\\downloads"); firefoxProfile.setPreference("browser.helperApps.neverAsk.saveToDisk","text/csv"); WebDriver driver = new FirefoxDriver(firefoxProfile);//new RemoteWebDriver(new URL("http://localhost:/wd/hub"), capability); driver.navigate().to("http://www.myfile.com/hey.csv");
You can use Robot key to perform action with popup windows