I have checked the option to "Ask where to save each file before downloading" in settings of my Chrome. But each time I am opening the Chrome using Chromedriver it is getting unchecked due to which the files are getting saved to the default download location.
What can I do so that the option does not get unchecked when I launch Chrome using Chromedriver?
I am using the following code block to launch chrome using chromedriver:
public static IWebDriver driver_chrome;
driver_chrome = new ChromeDriver();
/*Added for setting timeouts for other browser*/
driver_chrome.Manage().Timeouts().SetPageLoadTimeout(new TimeSpan(0, 2, 0));
driver_chrome.Navigate().GoToUrl("http://www.google.co.in");
if (driver_chrome.WindowHandles.Count >= 1)
{
driverTemp = driver_chrome;
}
I was able to achieve this using the following code snippet: