Selenium webdriver 硒铬与webworker崩溃

Selenium webdriver 硒铬与webworker崩溃,selenium-webdriver,webdriver,selenium-chromedriver,chromium,Selenium Webdriver,Webdriver,Selenium Chromedriver,Chromium,我正在使用: 铬73 铬铬驱动73 阿尔卑斯山3.9 硒爪哇 在CI(kuberenetes集群)中,由于我将WebWorker添加到测试中的应用程序代码中,我的web驱动程序出现崩溃 这里是事故日志- 我启用了chrome webdriver详细日志记录,我看到了这些行: [33751:33751:0709/175416.767497:ERROR:validation_errors.cc(76)] Invalid message: VALIDATION_ERROR_DESERIALIZAT

我正在使用:

  • 铬73
  • 铬铬驱动73
  • 阿尔卑斯山3.9
  • 硒爪哇
在CI(kuberenetes集群)中,由于我将WebWorker添加到测试中的应用程序代码中,我的web驱动程序出现崩溃

这里是事故日志-

我启用了chrome webdriver详细日志记录,我看到了这些行:

[33751:33751:0709/175416.767497:ERROR:validation_errors.cc(76)] Invalid message: VALIDATION_ERROR_DESERIALIZATION_FAILED (DevToolsAgentHost::ChildWorkerCreated deserializer)
[33751:33761:0709/175416.767545:ERROR:render_process_host_impl.cc(4800)] Terminating render process for bad Mojo message: Received bad user message: Validation failed for DevToolsAgentHost::ChildWorkerCreated deserializer [VALIDATION_ERROR_DESERIALIZATION_FAILED (DevToolsAgentHost::ChildWorkerCreated deserializer)
[33751:33761:0709/175416.767578:ERROR:bad_message.cc(27)] Terminating renderer for bad IPC message, reason 123
[1562694856.784][DEBUG]: DevTools WebSocket Event: Inspector.targetCrashed EBB11FCDAB2DEC02066BF3BCD6FF4F8D {

}
[1562694856.784][INFO]: Done waiting for pending navigations. Status: unknown error: cannot determine loading status
from tab crashed
[1562694856.835][INFO]: [d62047bf581d2bfcc6f681474fb0ea28] RESPONSE Navigate ERROR unknown error: session deleted because of page crash
from unknown error: cannot determine loading status
from tab crashed
  (Session info: chrome=73.0.3683.103)

尝试使用参数“--禁用dev shm用法”启动chrome。 JAVA示例:

  ChromeOptions options = new ChromeOptions();
  options.addArguments("--disable-dev-shm-usage");
最有可能的原因是内存问题


如果上述解决方案不起作用,那么您可以尝试

我在docker中尝试设置nightwatch+Chrome+chromedriver时遇到了完全相同的错误。我们的项目使用Auth0,而Auth0又使用web工作人员,其他一些没有web工作人员的站点也可以正常打开。我使用了
node:10alpine
图像,简单地安装了chrome和chromedriver,就像这样
apk添加chrome chromedriver chrome
,尝试了--特权模式和一堆chrome标志,但都不起作用

然后我试着用它作为基础(现在它安装了Chrome76),它成功了。最后的dockerfile是这样的

FROM node:10-slim AS test

RUN apt-get update --fix-missing && apt-get -y upgrade

RUN wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - \
    && sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list' \
    && apt-get update \
    && apt-get install -y google-chrome-stable --no-install-recommends \
    && rm -rf /var/lib/apt/lists/* \
    && rm -rf /src/*.deb
RUN npm install nightwatch chromedriver

# copy nightwatch files, etc


chrome在运行时使用了
--headless
--no sandbox
--disable gpu

有类似的问题:Alphine,chrome 73和相同的前三行日志。在我的例子中,它只在一些站点(不是每个页面)上失败,并且没有使用DevTools协议。您运行Chrome73而不是最新的stable 75(带有ChromeDriver)有什么特别的原因吗?我猜可能是某种回归,所以请尝试使用最新版本的stable。@tukan这是alpine repos中可用的最后一个版本。已经尝试在chrome中禁用shm,并通过docker选项调整shm的大小。不工作。