I am trying to save an image by using save as option inside a specific folder. I found a way by which I am able to right click on the image which I want to save using save a
For Chrome, it will works
String downloadFilepath = "/path/to/download";
HashMap chromePrefs = new HashMap();
chromePrefs.put("profile.default_content_settings.popups", 0);
chromePrefs.put("download.default_directory", downloadFilepath);
ChromeOptions options = new ChromeOptions();
options.setExperimentalOption("prefs", chromePrefs);
WebDriver driver = new ChromeDriver(options);