I'm doing an automation using Selenium with Chrome WebDriver. The application has to do a series of downloads that need to be saved with different names (Data + Report type) and folders that match the type of report I'm downloading.
The problem is that I can only set the default directory when I instantiate a new driver
var chromeOptions = new ChromeOptions();
chromeOptions.AddUserProfilePreference("download.default_directory", downloadDirectory);
chromeOptions.AddUserProfilePreference("intl.accept_languages", "nl");
chromeOptions.AddUserProfilePreference("disable-popup-blocking", "true");
IWebDriver driver = new ChromeDriver(@"location chromeDriver", chromeOptions);
driver.Navigate().GoToUrl(url);
So, I can not rename the file name or select the corresponding directory of the file I'm downloading, all of them with the same name and in the same folder. Does anyone have any idea how I can do this?