I want to automate test cases but chrome flags: 1). SameSite by default cookies. 2). Cookies without SameSite must be secure. 3). Schemeful Same-Site. are blocked me to loggin, so I want to disable these flags. I have tried below code, code are executed without any error but still issue is unresolved.
selenium version = 3.141.59 chromium version = 90.0.4430.24
my code :
WebDriverManager.chromiumdriver().setup(); ChromeOptions options = new ChromeOptions().setBinary("C:\Users\amans\AppData\Local\Chromium\Application\chrome.exe"); WebDriver driver = new ChromeDriver(options); driver.get("https://www.google.com");
HashMap<String, Object> chromeLocalStatePrefs = new HashMap<String, Object>();
List<String> experimentalFlags = new ArrayList<String>();
experimentalFlags.add("samesite-by-default-cookies@2");
experimentalFlags.add("cookies-without-samesite-must-be-secure@2");
experimentalFlags.add("schemeful-samesite@2");
chromeLocalStatePrefs.put("browser.enabled_labs_experiments", experimentalFlags);
options.setExperimentalOption("localState", chromeLocalStatePrefs);
System.out.println("cookkie");