简体   繁体   English

Chrome 无法启动:在 Selenium 测试中崩溃

[英]Chrome failed to start: crashed in Selenium testing

I am using C# Selenium for automated testing, and after the most recent chromedriver update 89.0.4389.2300, Google chrome starts and crashes right away.我正在使用 C# Selenium 进行自动化测试,在最近的 chromedriver 更新 89.0.4389.2300 之后,Google chrome 启动并立即崩溃。 The weirdest thing is that when I am running it on my local, everything works fine, but I am also using Azure pipelines to run my tests on a server.最奇怪的是,当我在本地运行它时,一切正常,但我也在使用 Azure 管道在服务器上运行我的测试。 The server one gives me this:服务器给我这个:

OpenQA.Selenium.WebDriverException: unknown error: Chrome failed to start: crashed. OpenQA.Selenium.WebDriverException:未知错误:Chrome 无法启动:崩溃。 (unknown error: DevToolsActivePort file doesn't exist) (The process started from chrome location C:\Program Files (x86)\Google\Chrome\Application\chrome.exe is no longer running, so ChromeDriver is assuming that Chrome has crashed.) (未知错误:DevToolsActivePort 文件不存在)(进程从 chrome 位置 C:\Program Files (x86)\Google\Chrome\Application\chrome.exe 不再运行,因此 ChromeDriver 假设 Chrome 已崩溃。 )

I have googled around and tried things like adding chromeOptions.AddArgument("--no-sandbox") and chromeOptions.AddArguments("disable-dev-shm-usage") but nothing helps.我已经四处搜索并尝试了添加 chromeOptions.AddArgument("--no-sandbox") 和 chromeOptions.AddArguments("disable-dev-shm-usage") 之类的方法,但没有任何帮助。 Chrome on my server is updated to the correct version too.我服务器上的 Chrome 也更新到正确的版本。 The tests run headless.测试无头运行。

Anyone else is having this issue?其他人有这个问题吗?

The error mentions that chromedriver could not bind to open debug port on running Chrome.该错误提到 chromedriver 在运行 Chrome 时无法绑定到打开调试端口。

Possible cases I met with:我遇到的可能案例:

  • old version of Chrome browser or chromedriver - since some version the port has changed旧版本的 Chrome 浏览器或 chromedriver - 由于某些版本的端口已更改
  • wrong Chrome binary location (chromedriver is looking for C:\Program Files (x86)\Google\Chrome\Application\chrome.exe )错误的 Chrome 二进制位置(chromedriver 正在寻找C:\Program Files (x86)\Google\Chrome\Application\chrome.exe

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 硒铬无法启动 - Selenium chrome failed to start OpenQA.Selenium.WebDriverException:未知错误:Chrome 无法启动:通过 Selenium 执行测试时异常退出 start on linux - OpenQA.Selenium.WebDriverException: unknown error: Chrome failed to start: exited abnormally while executing tests through Selenium start on linux OpenQA.Selenium.WebDriverException:未知错误:Chrome 无法启动:在 CodeFresh 上异常退出 - OpenQA.Selenium.WebDriverException : unknown error: Chrome failed to start: exited abnormally on CodeFresh 用于 Selenium 测试的独立镀铬 - Self-Contained Chrome for Selenium Testing C# Selenium - 无法启动 Tor - C# Selenium - Failed to Start Tor C# - Google chrome 在 docker Z0F4137ED1502B5045D2BAA8CZ 上运行 selenium 测试时崩溃 - C# - Google chrome is getting crashed when running selenium tests on docker windows 在 C# 中离线时使用 Selenium-WebDriver 测试 Chrome - Testing Chrome using Selenium-WebDriver while offline in C# 以编程方式启动用于Selenium测试的.NET Core Web应用程序 - Programmatically start a .NET Core web app for Selenium testing 使用Selenium WebDriver测试时检测无法加载的文件 - Detecting files that failed to load while testing with Selenium WebDriver C# Selenium 使用不同的用户配置文件启动 Chrome - C# Selenium Start Chrome with Different User Profile
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM