chromedriver, how to use predefind settings
Each time chromedriver opens a browser, it creates new profile. The profile overwrites all the chrome settings. "Continue where you left off
" option is part of the profile.
private static WebDriver startChrome() {
ChromeOptions options = new ChromeOptions();
options.addArguments("user-data-dir=c:\\temp\\chromeProf"); // Set non-default profile
Map<String, Object> prefs = new HashMap<>();
prefs.put("session.restore_on_startup", 1); // Edit profile preferences to be "Continue where you left off"
options.setExperimentalOption("prefs", prefs); // Set preferences to ChromeOptions
WebDriver driver = new ChromeDriver(options); // Start driver with those options
driver.manage().window().maximize();
return driver;
}