I am currently facing challenges with running Selenium automation tests in a Jenkins environment.
I have a scheduled jenkins job which run in every five minute and executes the automated test cases written in Selenium with TestNG framework. Using maven to manage build.
When I did the setup then it was working perfectly fine for few hours. But after few hours I started getting below error.
"*Error
org.openqa.selenium.SessionNotCreatedException: Could not start a new session. Response code 500. Message: unknown error: Chrome failed to start: crashed.
(unknown error: DevToolsActivePort file doesn’t exist)
(The process started from chrome location C:\Program Files\Google\Chrome\Application\chrome.exe is no longer running, so ChromeDriver is assuming that Chrome has crashed.)
Build info: version: ‘4.16.1’, revision: ‘9b4c83354e’
System info: os.name: ‘Windows Server 2012 R2’, os.arch: ‘amd64’, os.version: ‘6.3’, java.version: ‘11.0.16’
Driver info: org.openqa.selenium.chrome.ChromeDriver
Command: [null, newSession {capabilities=[Capabilities {browserName: chrome, goog:chromeOptions: {args: [–headless], extensions: []}}]}] "
I checked the version of chrome and chromedrive, there is no mismatch. Checked if there is any chromedriver instance is already running which might interrupt the flow but this was not the case.
Checked jenkins server memory and cpu utilisation to make sure if it has due to memory shortage, but this was not case.
So, I restarted the jenkins server and it started working again. But After few hours same issue appears.
Jenkins version- Jenkins 2.375.2
Maven version - 3.9.6
Selenium - 4.16.1