出现未知错误:Chrome无法启动:异常退出。 (未知错误:DevToolsActivePort文件不存在)

时间:2020-01-17 04:55:05

标签: linux docker selenium-chromedriver testng docker-container

通过带有standalone-chrome映像的docker容器运行TestNG脚本,在容器级别,chrome无法在Linux计算机上启动。

功能还包括:--disable-dev-shm-usage",--no-sandbox,--headless.

我尝试更新chrome驱动程序,但仍然无法正常工作。

org.openqa.selenium.WebDriverException: unknown error: Chrome failed to start: exited abnormally.
  (unknown error: DevToolsActivePort file doesn't exist)
  (The process started from chrome location /opt/google/chrome/chrome is no longer running, so ChromeDriver is assuming that Chrome has crashed.)

1 个答案:

答案 0 :(得分:2)

StackOverflow新手在这里。共享讨论中的Chrome / ChromeDriver版本会有所帮助。无论如何,我们都将其降级到了Chrome 78(+驱动程序),这个问题就消失了。似乎在较晚的版本中引入了此错误“ DevToolsActivePort文件不存在”。

一些陷阱:

  • 查找旧版本可能会出现问题;我们发现它们here对我们有用的版本是Linux_x64_693954_chrome-linux.zip
  • chrome-wrapper脚本应重命名为google-chrome
  • 必须将chrome_sandbox可执行文件重命名为chrome-sandbox并更改为4755
  • 安装匹配的Chromedriver版本78(chromedriver_78.0.3904.105)