Selenium 超时从渲染器接收消息 [英] Selenium Timed out receiving message from renderer

查看:29
本文介绍了Selenium 超时从渲染器接收消息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在 Chrome 昨天发布最新版本 (64.0.3282) 后,我现在偶尔收到此错误:

After Chrome released their newest version yesterday (64.0.3282), I am now receiving this error rather sporadically:

从渲染器接收消息超时:600.000

Timed out receiving message from renderer: 600.000

我在 docker 容器中运行了大约 2,000 次硒测试,我看到此失败的概率约为 100 分之一.据我所知,没有可重现的步骤 - 每次迭代失败的测试都不同.我更新到最新的 Chromedriver (2.35),但这似乎没有任何效果.我之前使用的是 Selenium 2.41,但已经更新到最新版本(3.8.1),希望它可能会有所帮助......它没有.我完全不知道为什么会发生这种情况.有没有其他人注意到这一点?这可能是 Chrome 最新版本的错误吗?

I'm running about 2,000 selenium tests within a docker container and I see this failure at a rate of about 1 in 100. There are no reproducible steps as far as I can tell- the tests that fail are different with each iteration. I updated to the newest Chromedriver (2.35), but that didn't seem to have any effect. I was previously using Selenium 2.41, but have updated to the newest version (3.8.1) hoping that it might help... it did not. I'm completely at a loss as to why this might be occurring. Has anyone else noticed this? Is it possibly a bug with Chrome's newest release?

提前感谢您提供的任何帮助.

Thank you in advance for any help you may be able to provide.

推荐答案

检查 JS 运行时

首先验证您没有执行/eval()大量的javascript.这可能会导致超时.

Check for JS Runtime

First verify you aren't executing / eval()ing a lot of javascript. That can cause a timeout.

首先,验证您的版本:

  • JDK
  • Chrome 驱动程序

都是兼容的.祝你好运,因为没有一个地方可以记录它,而且 selenium 软件不够聪明,无法进行快速检查(应该)

are all compatible. Good luck doing this because there is no single place that documents it, AND selenium software isn't smart enough to do a quick check (it should)

添加这个神秘的代码块,我喜欢称之为不断增长的无用参数列表"chromedriver 需要

Add this cryptic block of code, what I like to call the "Ever Growing List of Useless Arguments" chromedriver requires

截至 2018 年 9 月

// ChromeDriver is just AWFUL because every version or two it breaks unless you pass cryptic arguments
//AGRESSIVE: options.setPageLoadStrategy(PageLoadStrategy.NONE); // https://www.skptricks.com/2018/08/timed-out-receiving-message-from-renderer-selenium.html
options.addArguments("start-maximized"); // https://stackoverflow.com/a/26283818/1689770
options.addArguments("enable-automation"); // https://stackoverflow.com/a/43840128/1689770
options.addArguments("--headless"); // only if you are ACTUALLY running headless
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
driver = new ChromeDriver(options);

来源:

这篇关于Selenium 超时从渲染器接收消息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆