0

I tried setting chrome pref usinf ChromeOption class using the following code snippet

Map<String, String> prefs = new Hashtable<String, String>();
prefs.put("download.prompt_for_download", "true");
DesiredCapabilities capabilities = DesiredCapabilities.chrome();
capabilities.setCapability("prefs", prefs);
//capabilities.setCapability("download.prompt_for_download", true);
driver = new EventFiringWebDriver(new ChromeDriver(capabilities));

But no luck I am using latest driver version 2.35. I wanted to set prompt for download.

Arran
  • 24,648
  • 6
  • 68
  • 78
AAA
  • 348
  • 1
  • 4
  • 19
  • https://code.google.com/p/chromedriver/source/browse/CapabilitiesAndSwitches.wiki?spec=svn.wiki.0eeb3aab6943a35834ddcd80005395bb03b33352&repo=wiki&r=0eeb3aab6943a35834ddcd80005395bb03b33352 Can this be of anyhelp? – chaosguru Oct 02 '13 at 17:32
  • View this answer. It might help. https://stackoverflow.com/questions/27824124/how-to-change-file-download-location-in-webdriver-while-using-chrome-driver-fire – Rohit Singh May 28 '18 at 09:20

1 Answers1

1

Sometimes there can be a small issue with string version of boolean's and the actual boolean (i.e "true" vs true)

So I'd give this a test (untested):

Map<String, Boolean> prefs = new Hashtable<String, Boolean>();
prefs.put("download.prompt_for_download", true);
DesiredCapabilities capabilities = DesiredCapabilities.chrome();
capabilities.setCapability("prefs", prefs);
driver = new EventFiringWebDriver(new ChromeDriver(capabilities));
Arran
  • 24,648
  • 6
  • 68
  • 78