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

I have the following popup of chrome browser which I cannot close by program with selenium java:As I su

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!

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744805107a4594727.html

相关推荐

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

    I have the following popup of chrome browser which I cannot close by program with selenium java:As I su

    2天前
    40

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信