Error "System.InvalidOperationException: session not created: Microsoft Edge failed to start: crashed."

Hi All,

I’m trying to run job on Windows machine with Jenkins for Selenium C# tests.
It successfully clears previous data, downloads code and NuGet packages and build it, discovers tests and trying to run, but fails with such an error:

Starting test execution, please wait…
A total of 1 test files matched the specified pattern.
Failed UITestJenkins [4 s]
Error Message:
Test method .CreateSDA.UITestJenkins threw exception:
System.InvalidOperationException: session not created: Microsoft Edge failed to start: crashed.
(chrome not reachable)
(The process started from msedge location C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe is no longer running, so msedgedriver is assuming that msedge has crashed.) (SessionNotCreated)
Stack Trace:
at OpenQA.Selenium.WebDriver.UnpackAndThrowOnError(Response errorResponse, String commandToExecute)
at OpenQA.Selenium.WebDriver.Execute(String driverCommandToExecute, Dictionary`2 parameters)
at OpenQA.Selenium.WebDriver.StartSession(ICapabilities desiredCapabilities)
at OpenQA.Selenium.WebDriver…ctor(ICommandExecutor executor, ICapabilities capabilities)
at OpenQA.Selenium.Chromium.ChromiumDriver…ctor(ChromiumDriverService service, ChromiumOptions options, TimeSpan commandTimeout)
at Microsoft.Dynamics365.UIAutomation.Browser.BrowserDriverFactory.CreateWebDriver(BrowserOptions options) in C:\Workspace2\Microsoft.Dynamics365.UIAutomation.Browser\BrowserDriverFactory.cs:line 42
at Microsoft.Dynamics365.UIAutomation.Browser.InteractiveBrowser.get_Driver() in C:\Workspace2\Microsoft.Dynamics365.UIAutomation.Browser\InteractiveBrowser.cs:line 83
at Inkubit.CreateSDA.UITestJenkins() in C:\Workspace2\Microsoft.Dynamics365.UIAutomation.Sample
\Create\CreateSDA.cs:line 486

Test successfully runs manually from VS, also browser is available and can be started manually from defined location, msedgedriver version is also correct.

May be some additional settings need to be done?

Did you ever find a solution to this, I’m literally doing the same exact kind of solution (Selenium 4, C#, Nuget, jenkins running it all) and seeing the same exact error. Works fine in VS. Having a hard time finding an answer.