运行场景时出现以下错误。
org.openqa.selenium.TimeoutException: timeout: Timed out receiving message from renderer: 10.000
(Session info: chrome=79.0.3945.79) Build info: version: '3.14.0', revision: 'aacccce0', time: '2018-08-02T20:19:58.91Z' System info: host: 'fv-az598', ip: '10.1.0.4', os.name: 'Linux', os.arch: 'amd64', os.version: '4.15.0-1064-azure', java.version: '1.8.0_212' Driver info: org.openqa.selenium.remote.RemoteWebDriver Capabilities {acceptInsecureCerts: false, browserName: chrome, browserVersion: 79.0.3945.79, chrome: {chromedriverVersion: 79.0.3945.36
正如您所看到的,使用粗体、突出显示的字体,我确实有 chrome 和 chrome 驱动程序的匹配版本。
我还向我的 ChromeOptions 传递了一些参数,这意味着超时方面的帮助:
// options to prevent TIMEOUTS
options.addArguments("start-maximized"); //https://stackoverflow.com/a/26283818/1689770
options.addArguments("enable-automation"); //https://stackoverflow.com/a/43840128/1689770
options.addArguments("--no-sandbox"); //https://stackoverflow.com/a/50725918/1689770
options.addArguments("--disable-infobars"); //https://stackoverflow.com/a/43840128/1689770
options.addArguments("--disable-dev-shm-usage"); //https://stackoverflow.com/a/50725918/1689770
options.addArguments("--disable-browser-side-navigation"); //https://stackoverflow.com/a/49123152/1689770
options.addArguments("--disable-gpu"); //https://stackoverflow.com/questions/51959986/how-to-solve-selenium-chromedriver-timed-out-receiving-message-from-renderer-exc
options.addArguments("--disable-features=VizDisplayCompositor"); //https://stackoverflow.com/questions/55373625/getting-timed-out-receiving-message-from-renderer-600-000-when-we-execute-selen
编辑:在 DOCKER 容器中运行时会发生这种情况(使用适用于 chrome 浏览器的最新 docker 镜像和 node-chrome-debug)
任何想法都将不胜感激。
最佳答案
此错误消息...
org.openqa.selenium.TimeoutException: timeout: Timed out receiving message from renderer: 10.000
...意味着 ChromeDriver 无法启动/生成新的浏览上下文,即 Chrome 浏览器 session 。
您的主要问题是您使用的二进制文件版本之间不兼容,如下所示:
- 您的 Selenium 客户端版本是 2018-08-02T20:19:58.91Z 的 3.14.0,几乎是 1.5 岁数大,并且并发的 ChromeDriver 符合 OSS 标准。
- 您正在使用 chromedriver=79.0
- 您正在使用chrome=79.0
- 虽然 chromedriver=79.0 和 chrome=79.0 是并发的,但它们与 Selenium Client 版本 3.14.0 不兼容.
因此,Selenium Client v3.14.0、ChromeDriver v79.0 和 Chrome 浏览器 v79.0 之间存在明显不匹配 p> <小时/>
解决方案
确保:
- JDK 已升级到当前级别 JDK 8u222 .
- Selenium 升级至当前级别 Version 3.141.59 .
- 通过IDE清理您的项目工作区,并仅使用所需的依赖项重建项目。
tl;博士
您可以在以下位置找到一些相关讨论:
关于java - 从渲染器接收消息超时 : 10. 000,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59630332/