【问题标题】:org.openqa.selenium.remote.UnreachableBrowserException: Error communicating with the remote browser. It may have diedorg.openqa.selenium.remote.UnreachableBrowserException:与远程浏览器通信时出错。它可能已经死了
【发布时间】:2013-11-01 11:22:04
【问题描述】:

我在模拟器上运行测试时遇到以下错误。

org.openqa.selenium.remote.UnreachableBrowserException: Error communicating with the remote browser. It may have died.
Caused by: org.apache.http.NoHttpResponseException: The target server failed to respond

有人可以帮助我吗? 提前致谢

【问题讨论】:

    标签: selenium android-emulator selenium-webdriver


    【解决方案1】:

    当您关闭浏览器而不释放 remotewebdriver 时,selenium 服务器会在一段时间后自动清理您的会话。如果您在 selenium 服务器清理会话时运行测试,则当前会话可能会被释放并导致此错误。

    尝试在每个测试中运行remotedrive.Close(),或者只是重新启动服务器。

    【讨论】:

      【解决方案2】:

      尝试用这种方式初始化浏览器: AndroidDriver驱动=新的AndroidDriver();

      【讨论】:

        猜你喜欢
        • 2016-12-15
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2019-01-24
        • 2013-09-07
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多