【问题标题】:"Exception in thread "main" org.openqa.selenium.WebDriverException: disconnected: received Inspector.detached event" with Selenium Java“线程“主”org.openqa.selenium.WebDriverException 中的异常:断开连接:收到 Inspector.detached 事件”与 Selenium Java
【发布时间】:2021-08-18 07:30:34
【问题描述】:

我在我的 mac OS (Catalina 10.15.7) 上使用 Selenium Java w/chromedriver 时不断收到此错误,

Exception in thread "main" org.openqa.selenium.WebDriverException: disconnected: received Inspector.detached event

我用谷歌搜索,有人说当你在谷歌浏览器上打开 Chrome 开发者工具时会发生这种情况。我没有任何打开的 Windows,但它仍在发生。

我正在使用 Google Chrome 版本 91.0.4472.77chromedriver 版本 91.0.4472.19。对这里发生的事情有任何想法吗?有时我可以让应用程序成功运行 1 次,但 90% 的情况下它会抛出此异常 - 发生了什么?

【问题讨论】:

    标签: java selenium selenium-chromedriver ui-automation


    【解决方案1】:

    在您的chromeOptions 中,当您初始化chromedriver 时,添加以下内容:

    chromeOptions.setPageLoadStrategy(PageLoadStrategy.NONE);
    

    让我知道这是否有帮助。

    【讨论】:

    • 实际上,我认为它现在似乎有所帮助。
    猜你喜欢
    • 2019-12-28
    • 2019-12-15
    • 1970-01-01
    • 2018-12-31
    • 1970-01-01
    • 2019-04-03
    • 2014-10-25
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多