2
I’m doing an automation using Selenium with Chrome Webdriver. The application has to make a series of downloads that need to be saved with different names (Report Date + Type) and in 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);
Therefore, I cannot rename the file name or select the corresponding directory of the file I am downloading, all with the same name and in the same folder. Does anyone have any idea how I can do that?