I want to download a file in chrome by "Save Link as" and change the filename and location of that file. Below is the code I have written so far to handle the windows pop-up. But in the directory, I am getting a temp file instead Any help would be appreciated.
System.setProperty("webdriver.chrome.driver","C://Users//mansi.shrimali//workspace//Redmine_01//chromedriver01.exe");
Properties pro= new Properties();
FileInputStream fip =new FileInputStream(System.getProperty("user.dir") +"/src/Config.properties");
pro.load(fip);
String URL=pro.getProperty("BrowserURL");
String downloadFilepath = "D:/Download";
ChromeOptions options = new ChromeOptions();
HashMap<String, Object> chromePrefs = new HashMap<String, Object>();
chromePrefs.put("profile.default_content_settings.popups", 0);
chromePrefs.put("download.default_directory", downloadFilepath);
options.setExperimentalOption("prefs", chromePrefs);
//options.addArguments("--disable-extensions");
DesiredCapabilities cap = DesiredCapabilities.chrome();
cap.setCapability(CapabilityType.ACCEPT_SSL_CERTS, true);
cap.setCapability(ChromeOptions.CAPABILITY, options);
driver = new ChromeDriver(options);