简体   繁体   English

OpenQA.Selenium.WebDriverException:未知错误:Chrome 无法启动:在 CodeFresh 上异常退出

[英]OpenQA.Selenium.WebDriverException : unknown error: Chrome failed to start: exited abnormally on CodeFresh

While running smoke tests in CodeFresh we occasionally get this error在 CodeFresh 中运行冒烟测试时,我们偶尔会遇到此错误

[xUnit.net 00:02:41.43]       OpenQA.Selenium.WebDriverException : unknown error: Chrome failed to start: exited abnormally.
[xUnit.net 00:02:41.43]         (unknown error: DevToolsActivePort file doesn't exist)
[xUnit.net 00:02:41.43]         (The process started from chrome location /usr/bin/google-chrome is no longer running, so ChromeDriver is assuming that Chrome has crashed.)
[xUnit.net 00:02:41.43]       Stack Trace:
[xUnit.net 00:02:41.43]            at OpenQA.Selenium.Remote.RemoteWebDriver.UnpackAndThrowOnError(Response errorResponse)
[xUnit.net 00:02:41.43]            at OpenQA.Selenium.Remote.RemoteWebDriver.Execute(String driverCommandToExecute, Dictionary`2 parameters)
[xUnit.net 00:02:41.43]            at OpenQA.Selenium.Remote.RemoteWebDriver.StartSession(ICapabilities desiredCapabilities)
[xUnit.net 00:02:41.43]            at OpenQA.Selenium.Remote.RemoteWebDriver..ctor(ICommandExecutor commandExecutor, ICapabilities desiredCapabilities)
[xUnit.net 00:02:41.43]            at OpenQA.Selenium.Chrome.ChromeDriver..ctor(ChromeDriverService service, ChromeOptions options, TimeSpan commandTimeout)
[xUnit.net 00:02:41.43]            at OpenQA.Selenium.Chrome.ChromeDriver..ctor(ChromeOptions options)
[xUnit.net 00:02:41.43]         /src/Features/Helpers/Hooks.cs(32,0): at Live_Automation.Features.Helpers.Hooks.BeforeScenario()
[xUnit.net 00:02:41.43]            at TechTalk.SpecFlow.Bindings.BindingInvoker.InvokeBinding(IBinding binding, IContextManager contextManager, Object[] arguments, ITestTracer testTracer, TimeSpan& duration)
[xUnit.net 00:02:41.43]            at TechTalk.SpecFlow.Infrastructure.TestExecutionEngine.InvokeHook(IBindingInvoker invoker, IHookBinding hookBinding, HookType hookType)
[xUnit.net 00:02:41.43]            at TechTalk.SpecFlow.Infrastructure.TestExecutionEngine.FireEvents(HookType hookType)
[xUnit.net 00:02:41.43]            at TechTalk.SpecFlow.Infrastructure.TestExecutionEngine.OnScenarioStart()
[xUnit.net 00:02:41.43]            at TechTalk.SpecFlow.TestRunner.OnScenarioStart()
[xUnit.net 00:02:41.43]            at Live_Automation.Features.SmokeTestsOnLiveFeature.ScenarioStart()

This happens on average 1 test run in 10 and often it is just one scenario as below这种情况平均发生在 10 次测试运行中,通常只是下面的一种情况

Test Run Failed.
Total tests: 52
     Passed: 51
     Failed: 1

The failing test is random as is the time of day this may happen.失败的测试是随机的,因为这可能发生在一天中的时间。 The test suite is built around Visual Studio/C#/Selenium/Xunit测试套件围绕 Visual Studio/C#/Selenium/Xunit 构建

On an either rarer occasion we get this在极少数情况下,我们会得到这个

[xUnit.net 00:03:26.88]       OpenQA.Selenium.WebDriverException : unknown error: session deleted because of page crash
[xUnit.net 00:03:26.88]       from unknown error: cannot determine loading status
[xUnit.net 00:03:26.88]       from tab crashed
[xUnit.net 00:03:26.88]         (Session info: headless chrome=87.0.4280.141)
[xUnit.net 00:03:26.88]       Stack Trace:
[xUnit.net 00:03:26.88]            at OpenQA.Selenium.Remote.RemoteWebDriver.UnpackAndThrowOnError(Response errorResponse)
[xUnit.net 00:03:26.88]            at OpenQA.Selenium.Remote.RemoteWebDriver.Execute(String driverCommandToExecute, Dictionary`2 parameters)
[xUnit.net 00:03:26.88]            at OpenQA.Selenium.Remote.RemoteWebDriver.set_Url(String value)
[xUnit.net 00:03:26.88]            at OpenQA.Selenium.Remote.RemoteNavigator.GoToUrl(String url)
[xUnit.net 00:03:26.88]         /src/Features/Pages/HomePage.cs(61,0): at Live_Automation.Features.Pages.HomePage.Visit()
[xUnit.net 00:03:26.88]            at TechTalk.SpecFlow.Bindings.BindingInvoker.InvokeBinding(IBinding binding, IContextManager contextManager, Object[] arguments, ITestTracer testTracer, TimeSpan& duration)
[xUnit.net 00:03:26.88]            at TechTalk.SpecFlow.Infrastructure.TestExecutionEngine.ExecuteStepMatch(BindingMatch match, Object[] arguments)
[xUnit.net 00:03:26.88]            at TechTalk.SpecFlow.Infrastructure.TestExecutionEngine.ExecuteStep(IContextManager contextManager, StepInstance stepInstance)
[xUnit.net 00:03:26.88]            at TechTalk.SpecFlow.Infrastructure.TestExecutionEngine.OnAfterLastStep()
[xUnit.net 00:03:26.88]            at TechTalk.SpecFlow.TestRunner.CollectScenarioErrors()
[xUnit.net 00:03:26.88]            at Live_Automation.Features.SmokeTestsOnLiveFeature.ScenarioCleanup()
[xUnit.net 00:03:26.88]         /src/Features/SmokeTests.feature(80,0): at Live_Automation.Features.SmokeTestsOnLiveFeature.TestFooterOptions(String footer, String url, String[] exampleTags)

Now when this happens all scenarios from this point will fail Has anyone got any ideas please about what is causing this.现在,当发生这种情况时,从这一点开始的所有场景都将失败有没有人对造成这种情况的原因有任何想法。 I do not think it is the tests.我不认为这是测试。

Thanks in advance提前致谢

Kev凯夫

it means somewhere you are using send_keys(filepath) and the file doesn't exists in that path这意味着您正在使用 send_keys(filepath) 的某个地方并且该文件不存在于该路径中

see if you are using this some where看看你是否在某些地方使用它

I have resolved this issue.我已经解决了这个问题。 Since adding this line there have been no problems.自添加此行以来,没有任何问题。

options.AddArguments("--disable-dev-shm-usage");

暂无
暂无

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

相关问题 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 C# OpenQA.Selenium.WebDriverException:“未知错误:无法创建 Chrome 进程。” - C# OpenQA.Selenium.WebDriverException: 'unknown error: Failed to create Chrome process.' OpenQA.Selenium.WebDriverException - OpenQA.Selenium.WebDriverException OpenQA.Selenium.WebDriverException:未知错误:a.tagName.toUpperCase 不是通过 Selenium 和 C# 带有 reactJS 元素的函数 - OpenQA.Selenium.WebDriverException : unknown error: a.tagName.toUpperCase is not a function with reactJS elements through Selenium and C# 异常:OpenQA.Selenium.WebDriverException: - Exception :OpenQA.Selenium.WebDriverException: OpenQA.Selenium.WebDriverException Firefox无法启动 - OpenQA.Selenium.WebDriverException firefox won't start up OpenQA.Selenium.WebDriverException:'意外的服务器错误。 使用EdgeOptions - OpenQA.Selenium.WebDriverException: 'Unexpected server error.' using EdgeOptions OpenQA.Selenium.WebDriverException:'未知错误:ChromeDriver 仅支持 BMP 中的字符,同时通过 C# Selenium 发送表情符号 - OpenQA.Selenium.WebDriverException: 'unknown error: ChromeDriver only supports characters in the BMP while sending an emoji through C# Selenium OpenQA.Selenium.WebDriverException Message=无法在 http://localhost:port/ 上通过 C# 中的 Selenium 使用 ChromeDriver Chrome 启动驱动程序服务 - OpenQA.Selenium.WebDriverException Message=Cannot start the driver service on http://localhost:port/ using ChromeDriver Chrome through Selenium in C# WebDriver.dll中发生了'OpenQA.Selenium.WebDriverException'类型的未处理异常。其他信息:意外错误。 未知错误 - An unhandled exception of type 'OpenQA.Selenium.WebDriverException' occurred in WebDriver.dll Additional information: Unexpected error. Unknown error
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM