Scenario: There is download button in web Application. Now I need to download Multiple files via a Button click.
Map<String, Object>preferences=new Hashtable<String, Object>();
preferences.put("profile.default_content_settings.popups", 0);
preferences.put("download.prompt_for_download", true);
preferences.put("download.default_directory",downloadpath);
preferences.put("profile.content_settings.pattern_pairs.*.multiple-automatic-downloads", 4 );
preferences.put("profile.content_settings.exceptions.automatic_downloads.*.setting", 4 );
ChromeOptions options = new ChromeOptions();
options.addArguments("--no-sandbox", "--disable-extensions", "--disable-gpu");
options.setExperimentalOption("prefs", preferences);
DesiredCapabilities cap = DesiredCapabilities.chrome();
cap.setCapability(CapabilityType.ACCEPT_SSL_CERTS, true);
cap.setCapability(ChromeOptions.CAPABILITY, options);
These are options for ChromeOption. I am not much aware of ChromeOption/FirefoxOption.