超时从渲染器接收消息:600.000当我们使用Jenkins Windows服务模式执行Selenium脚本时 [英] Getting Timed out receiving message from renderer: 600.000 When we execute selenium scripts using Jenkins windows service mode
问题描述
我们每天都在使用jenkins窗口服务(无头模式)来执行硒自动化脚本.直到昨天,它的运行情况还不错.突然,它停止工作并且没有启动浏览器.它显示以下错误消息[1553677874.187] [SEVERE]:超时从渲染器接收消息:600.000.之后,所有其他测试用例都将失败.
We are executing our selenium automation script using jenkins window service(Headless mode) on daily basis .it was working fine till yesterday. suddenly it stopped working and not launching the browser. it shows the below error message [1553677874.187][SEVERE]: Timed out receiving message from renderer: 600.000. after that all the remaining test cases are getting failed.
如果我们使用没有Windows服务的jenkins运行构建,则工作正常.我们仅使用Windows即服务
It is working fine if we run the build using jenkins as without windows service. We are experiencing this issue only with windows as service
- 我的Chrome驱动程序版本:73.0.3683.68
- Chrome浏览器版本:73.0.3683.68
- 硒版本:3.14.0
我试图降级浏览器版本和驱动程序版本.即使它不起作用
I have tried to downgrade the browser version and driver version. even though it is not working
我希望当我们使用jenkins作为Windows服务执行但收到错误消息时,浏览器应该在后台启动.
I am expecting the browser should launch in the background when we execute using jenkins as windows service but getting error message.
System.setProperty("webdriver.chrome.driver", "C:\\chromedriver.exe");
ChromeOptions options = new ChromeOptions();
options.addArguments("load-extension=C:\\1.13.4_0");
options.addArguments("--start-maximized");
options.addArguments("--ignore-certificate-errors");
options.addArguments("--disable-popup-blocking");
// options.addArguments("window-size=1400,600");
options.addArguments("enable-automation");
options.addArguments("--headless");
options.addArguments("--window-size=1920,1080");
options.addArguments("--no-sandbox");
// options.addArguments("--disable-extensions");
options.addArguments("--dns-prefetch-disable");
options.addArguments("--disable-gpu");
options.setPageLoadStrategy(PageLoadStrategy.NORMAL);
DesiredCapabilities capabilities =
DesiredCapabilities.chrome();
capabilities.setCapability(ChromeOptions.CAPABILITY,
**strong text**options);
return new ChromeDriver(capabilities);
推荐答案
似乎您正在使用以下配置:
Seems you are using the following configuration:
- chromedriver = 73.0.3683.68
- chrome = 73.0.3683.68
- Windows操作系统
- chromedriver=73.0.3683.68
- chrome=73.0.3683.68
- Windows OS
John Chen(Chromedriver的所有者)最近证实了这一点,
John Chen (Owner - chromedriver) recently have confirmed that,
我们已确认Windows上的某项服务(例如Jenkins或Task Scheduler)启动Chrome 73.0.3686.75时拍摄屏幕截图存在问题.有关更多详细信息,请参见 https://crbug.com/942023 .不便之处,敬请原谅.但是,我们尚未能够在Linux上观察到类似的问题,因此,我们感谢您提供的任何帮助,以使我们能够在Linux上重现该问题.我们没有使用TeamCity的权限,但是我们已经测试了使用Selenium生成的Docker映像(selenium/standalone-chrome:3.141.59-lithium)截取屏幕截图,没有发现任何问题.
We have confirmed issues with take screenshot when Chrome 73.0.3686.75 is started by a service (such as Jenkins or Task scheduler) on Windows. Please see https://crbug.com/942023 for more details. We apologize for any inconvenience caused by this. However, we haven't yet been able to observe similar issue on Linux, so we appreciate any help you can provide to enable us to reproduce the issue on Linux. We don't have access to TeamCity, but we have tested take screenshot using Docker image produced by Selenium (selenium/standalone-chrome:3.141.59-lithium), and didn't find any problems.
昨天(2019年3月26日),约翰再次确认:
Yesterday (Mar 26, 2019), John once again confirmed:
我知道从Jenkins运行Chrome 73时会遇到一些问题.我不知道有任何解决方法.请关注 https://crbug.com/942023 进行更新.
我们能够挖掘出主要问题.主要问题不是 ChromeDriver v73.x 本身,而是 Chrome v73.x ,John正式确认为:
We were able to dig up the main issue. The main issue is not with ChromeDriver v73.x as such but with Chrome v73.x and John officially confirms it as:
根本原因确实是在Chrome 73.x中,而不是在ChromeDriver中.我们正在与Chrome开发人员一起寻找解决方案.
The root cause is indeed in Chrome 73.x, not in ChromeDriver. We are working with Chrome devs to find a solution.
一种快速解决方案是:
- 将 Chrome浏览器降级为 Chrome v72.x
- 在以下各项中使用匹配的 ChromeDriver :
- Downgrade Chrome Browser to Chrome v72.x
- Use a matching ChromeDriver among:
- ChromeDriver 2.46
- ChromeDriver 72.0.3626.69
注意:如果您使用的是Chrome版本72,请下载ChromeDriver 2.46或ChromeDriver 72.0.3626.69
Note: If you are using Chrome version 72, please download ChromeDriver 2.46 or ChromeDriver 72.0.3626.69
- 确保将 JDK 升级到
- Ensure that JDK is upgraded to recent level of JDK 8u202.
- Page.captureScreenshot在Selenium下的Chrome 73中不再适用Windows服务
- 错误[SEVERE]:在Jenkins上通过Selenium执行测试套件时,超时从渲染器接收消息:20.000
- 下载Google Chrome 72适用于所有操作系统的脱机安装程序
- Page.captureScreenshot no longer works in Chrome 73 under Selenium as a Service on Windows
- Error [SEVERE]: Timed out receiving message from renderer: 20.000 while executing the testsuite through Selenium on Jenkins
- Download Google Chrome 72 Offline Installer For All Operating Systems
您可以在以下位置找到相关讨论:
You can find the relevant discussions in:
通过
ChromeOptions()
的实例添加参数--disable-features=VizDisplayCompositor
似乎可以解决此问题:Adding the argument
--disable-features=VizDisplayCompositor
through an instance ofChromeOptions()
seems solves the issue:ChromeOptions options = new ChromeOptions(); options.addArguments("--disable-features=VizDisplayCompositor"); WebDriver driver = new ChromeDriver(options); driver.get("https://google.com");
这篇关于超时从渲染器接收消息:600.000当我们使用Jenkins Windows服务模式执行Selenium脚本时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!