Could not start a new session on Jenkins server

Hi! I have an issue with creating session on server while trying to run automated tests - for Firefox and Chrome. Locally tests work fine but not on provided to me Jenkins server. Unfortunately I don’t know much about it’s configuration so I’m stuck. At first I had many proxy issues, but now I don’t know what to do next. I asked and chrome and firefox should be installed on server

[ERROR] Tests run: 3, Failures: 1, Errors: 0, Skipped: 2, Time elapsed: 1.763 s <<< FAILURE! - in XXX.Tests.LoginTests
[ERROR] XXX.Tests.LoginTests.beforeTest Time elapsed: 1.485 s <<< FAILURE!
org.openqa.selenium.SessionNotCreatedException:
Could not start a new session. Response code 500. Message: Process unexpectedly closed with status 1
Host info: host: ‘PFALT224183’, ip: ‘10.61.224.183’
Build info: version: ‘4.21.0’, revision: ‘79ed462ef4’
System info: os.name: ‘Linux’, os.arch: ‘amd64’, os.version: ‘6.2.0-1018-azure’, java.version: ‘17.0.9’
Driver info: org.openqa.selenium.firefox.FirefoxDriver
Command: [null, newSession {capabilities=[Capabilities {acceptInsecureCerts: true, browserName: firefox, moz:debuggerAddress: true, moz:firefoxOptions: {binary: /usr/bin/firefox}}]}]

For Chrome:

org.openqa.selenium.SessionNotCreatedException:
Could not start a new session. Response code 500. Message: session not created: Chrome failed to start: exited normally.
(session not created: DevToolsActivePort file doesn’t exist)
(The process started from chrome location /usr/bin/google-chrome is no longer running, so ChromeDriver is assuming that Chrome has crashed.)
Host info: host: ‘PFALT224183’, ip: ‘10.61.224.183’
Build info: version: ‘4.21.0’, revision: ‘79ed462ef4’
System info: os.name: ‘Linux’, os.arch: ‘amd64’, os.version: ‘6.2.0-1018-azure’, java.version: ‘17.0.9’
Driver info: org.openqa.selenium.chrome.ChromeDriver
Command: [null, newSession {capabilities=[Capabilities {browserName: chrome, goog:chromeOptions: {args: , binary: /usr/bin/google-chrome, extensions: }}]}]
at

Darin Pope created a video for Selenium testing on Jenkins that may help you.

Thank you. Unfortunately he has Jenkins locally and even his code works on my computer, it doesn’t work on Jenkins server

So the backing browsers do not start/fail fast. For most jenkins setups you need to use the headless versions (or run xvfb or the like) as there is no display attached to the jobs.