Reputation: 448
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.
Upvotes: 0
Views: 5321
Reputation: 25076
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));
Upvotes: 1