I have the following popup of chrome browser which I cannot close by program with selenium java:
As I suspect the selenium script cannot access the html DOM anymore and the script is stopped with an NoSuchElementException
after the popup is visible.
tried to click WebElement "close button"
I have the following popup of chrome browser which I cannot close by program with selenium java:
As I suspect the selenium script cannot access the html DOM anymore and the script is stopped with an NoSuchElementException
after the popup is visible.
tried to click WebElement "close button"
Share Improve this question asked Mar 11 at 9:16 LederLeder 3941 gold badge6 silver badges23 bronze badges1 Answer
Reset to default 0 ChromeOptions options = new ChromeOptions();
// Disable "Chrome is being controlled by automated test software" banner
options.addArguments("--disable-blink-features=AutomationControlled");
// Disable Chrome's "Save address?" popup
options.setExperimentalOption("prefs", Map.of(
"autofill.profile_enabled", false,
"credentials_enable_service", false,
"profile.password_manager_enabled", false,
"autofill.credit_card_enabled", false
));
that did the trick!