在运行场景时,我遇到了以下错误。
org.openqa.selenium.TimeoutException: timeout: Timed out receiving message from renderer: 10.000
(会话信息:chrome=79.0.3945.79) 构建信息:版本:'3.14.0',修订版:'aacccce0',时间:'2018-08-02T20:19:58.91Z' 系统信息: 主机:'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' 驱动程序信息: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://dev59.com/el8e5IYBdhLWcg3wS465#26283818
options.addArguments("enable-automation"); //https://dev59.com/el8e5IYBdhLWcg3wS465#43840128
options.addArguments("--no-sandbox"); //https://dev59.com/XFUL5IYBdhLWcg3wOl9x#50725918
options.addArguments("--disable-infobars"); //https://dev59.com/el8e5IYBdhLWcg3wS465#43840128
options.addArguments("--disable-dev-shm-usage"); //https://dev59.com/XFUL5IYBdhLWcg3wOl9x#50725918
options.addArguments("--disable-browser-side-navigation"); //https://dev59.com/z1YM5IYBdhLWcg3wvB_-#49123152
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://dev59.com/4bLma4cB1Zd3GeqPg9IG
编辑:这个问题发生在DOCKER容器中运行时(使用chrome浏览器和node-chrome-debug的最新docker镜像)
如有任何想法,将不胜感激。