最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

close chrome browser pop-up in java selenium automated - Stack Overflow

programmeradmin3浏览0评论

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 badges
Add a comment  | 

1 Answer 1

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!

发布评论

评论列表(0)

  1. 暂无评论