Search code examples
c#selenium-webdriverselenium-edgedriver

WebDriverException: unknown error: MSEdge failed to start: was killed


When I want to run my selenium UI test written in C# in my CD pipeline I get

EdgeDriverInitialize threw exception. OpenQA.Selenium.WebDriverException: OpenQA.Selenium.WebDriverException: unknown error: MSEdge failed to start: was killed. 2021-10-29T09:52:23.5882844Z (unknown error: DevToolsActivePort file doesn't exist) 2021-10-29T09:52:23.5883689Z
(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.). Aborting test execution.

QUESTION IS: How do I find out what's the problem?

I have tried to

  1. update the driver to match Edge version
  2. open Edge manually and it opened without problems
  3. check Event Log - in the applications log I haven't seen anything related to Edge or WebDriver

I have noticed, that when I run the msedgedriver.exe manually, it starts listeting on port 9515.

However in my CD pipeline I see:

Starting MSEdgeDriver 95.0.1020.30 (09f7018e2a65a55dea3a0a261efca40ae03471ed) on port 57341


Solution

  • I also faced with this problem. Locally or on a remote machine, when running tests, the browser opened and the tests passed. But when the tests were running by Jenkins, "devToolsActivePort file doesn't exist" error appeared in the log. Although, tests for Chrome and Firefox work without issue. The problem was only for Edge browser. We have a master Jenkins and slides where the tests are executed. It turned out that tests on Edge cannot be run under local system account. The tests were run under local system account on Jenkins. To solve this problem, I've created a new local user (called Jenkins) and gave him administrator rights on each slave, and then started Jenkins-slave service under Jenkins user. Now the tests run and pass successfully.