Jenkins - Microsoft Edge failed to start: crashed

Previously I had an issue connecting a windows agent to Jenkins. Then “This question” I referred and now I have connected a windows agent to Jenkins using a service wrapper.

But now the issue is, for doing the automation test “microsoft edge” browser should be launched while executing the pipeline. Now I am getting this error.


**Microsoft Edge WebDriver was started successfully.**
**[ERROR] Tests run: 15, Failures: 1, Errors: 0, Skipped: 14, Time elapsed: 2.794 s <<< FAILURE! - in TestSuite**
**[ERROR] beforeMethod(abc.test.Route)  Time elapsed: 1.605 s  <<< FAILURE!**
**org.openqa.selenium.WebDriverException: **
**unknown error: Microsoft Edge failed to start: crashed.**
**  (unknown error: DevToolsActivePort file doesn't exist)**
**  (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.)**
**Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:17:03'**
**System info: host: 'xxxxxx', ip: 'xxxxxx', os.name: 'Windows Server 2016', os.arch: 'amd64', os.version: '10.0', java.version: '11'**
**Driver info: driver.version: EdgeDriver**
**remote stacktrace: Backtrace:**
**    GetHandleVerifier [0x00007FF66B3F4AD2+67490]**
**    Microsoft::Applications::Events::EventProperty::~EventProperty [0x00007FF66B38B242+782402]**
**    (No symbol) [0x00007FF66B12C646]**
**    (No symbol) [0x00007FF66B15A5A1]**
**    (No symbol) [0x00007FF66B155941]**
**    (No symbol) [0x00007FF66B195A35]**
**    (No symbol) [0x00007FF66B18DD23]**
**    (No symbol) [0x00007FF66B162794]**
**    (No symbol) [0x00007FF66B1619B0]**
**    (No symbol) [0x00007FF66B162F04]**
**    Microsoft::Applications::Events::ILogManager::DispatchEventBroadcast [0x00007FF66B5B90D3+1301571]**
**    (No symbol) [0x00007FF66B1EB951]**
**    Microsoft::Applications::Events::EventProperty::~EventProperty [0x00007FF66B2D46C1+33985]**
**    Microsoft::Applications::Events::EventProperty::~EventProperty [0x00007FF66B2CCAF5+2293]**
**    Microsoft::Applications::Events::ILogManager::DispatchEventBroadcast [0x00007FF66B5B7E33+1296803]**
**    Microsoft::Applications::Events::EventProperty::~EventProperty [0x00007FF66B392589+811913]**
**    Microsoft::Applications::Events::EventProperty::~EventProperty [0x00007FF66B38EF04+797956]**
**    Microsoft::Applications::Events::EventProperty::~EventProperty [0x00007FF66B38EFFC+798204]**
**    Microsoft::Applications::Events::EventProperty::~EventProperty [0x00007FF66B3850B1+757425]**
**    BaseThreadInitThunk [0x00007FF92F4784D4+20]**
**    RtlUserThreadStart [0x00007FF9306D1791+33]**

**    at abc.test.Route.beforeMetho**d(Route.java:30)

when I execute directly on the server without using jenkins it executes perfectly. I think the reason is jenkins using a service account and that doesn’t allow to launch ms edge. Any solution for this ?

Thanks is advance…!

Windows services can not interact with the desktop. If you need to run UI based applications on a Windows agent, you need to launch an agent as the user while logged in as that user.

1 Like

Hi Alex, Thanks for the reply.
The thing is this windows server is a remote server which I connect from RDP. when I execute agent jar with the cmd command its connecting and executing everything fine, but when my RDP session expires server disconnects from jenkins. I cant always be logged into server from RDP. Thats why I am executing agent.jar from a service account. Is it possible to connect a windows agent to jenkins and keep it always connected without using JNLP connection.

Trying to do gui stuff on windows requires an active UI session. There is not an easy or well documented way on how to do it. You basically need to have a UI session that is running the agent via command and not service. There used to be a way to allow services to interact with the desktop, but MS removed that

Oops. our infra plan is to run automation tests via jenkins on a windows machine. Then this looks impossible. :expressionless:

Have you considered configuring an auto-login account on the Windows machine that then has an autostart script that runs the Jenkins inbound agent? It means that anyone with access to the keyboard of the machine can operate as the user that performed the autologin, but I would think it would work.

Hi Mark, Cool idea… I should try this. Thank you :slightly_smiling_face: