2

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

Liero
  • 25,216
  • 29
  • 151
  • 297
  • This error can occur for a few reasons. I'd start by checking the resources on the server the CD is running and your config file has the necessary properties to launch the browser. – Josh Adams Oct 29 '21 at 14:29
  • There is enough RAM, CPU, Diskspace. All other processes including edge runs just fine. What config do you mean? What config should I check? – Liero Oct 31 '21 at 09:18

2 Answers2

3

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.

1

I have the same issue as @Anya Mishota where our Gitlab runner edge tests have started to fail with this error.

I have found that this started occurring after Edge was updated to version 95. Rolling Edge back to version 94 and the tests work fine.

However, running the tests on a local user (that has admin rights) with version 95 worked fine. The Gitlab runner is service using the local system account. Running the service as an admin account resolved this issue!

keoppo
  • 11
  • 1
  • That's interesting and it sucks, because I don't want to run my tests as admin :O – Liero Nov 11 '21 at 16:19
  • Fair enough, perhaps you can try change the account roles/permissions of the local user and see if it works also. – keoppo Nov 12 '21 at 04:26