I'm trying to use code which I found on Stackoverflow in other topics to do not ask user about action which should be taken to download PDF file.
Code which I'm using is:
FirefoxProfile specialProfile = new FirefoxProfile();
specialProfile.SetPreference("browser.helperApps.alwaysAsk.force", false);
specialProfile.SetPreference("browser.download.manager.showWhenStarting", false);
specialProfile.SetPreference("browser.download.folderList", 2);
specialProfile.SetPreference("browser.download.dir", Setup.DownloadContractPath);
specialProfile.SetPreference("services.sync.prefs.sync.browser.download.manager.showWhenStarting", false);
specialProfile.SetPreference("browser.download.useDownloadDir", true);
specialProfile.SetPreference("browser.helperApps.neverAsk.saveToDisk", "application/pdf");
return new FirefoxDriver(specialProfile);
But it seems that it's not working in my case. File I'm downloading is the type: PDF And even if i'm using the code above i got the following screen:
Does anyone know what may i do wrong?