I have created a pipeline on jenkins (Centos server) and trying a run selenium test (command: mvn clean install) but during the build phase on jenkin the following error is displayed:
Running mu.automate.TestCaseService
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
Starting ChromeDriver 106.0.5249.21 (71f4e2c9a6f38f5550a8ea29a984a08304554956-refs/branch-heads/5249@{#228}) on port 40216
Only local connections are allowed.
Please see https://chromedriver.chromium.org/security-considerations for suggestions on keeping ChromeDriver safe.
ChromeDriver was started successfully.
Tests run: 3, Failures: 2, Errors: 0, Skipped: 1, Time elapsed: 1.243 sec <<< FAILURE!
Results :
Failed tests: setUp(dummy.automate.TestCaseService): Could not start a new session. Response code 500. Message: unknown error: cannot find Chrome binary
tearDown(dummy.automate.TestCaseService)
Tests run: 3, Failures: 2, Errors: 0, Skipped: 1
I have downloaded the latest driver from the link below:
https://chromedriver.chromium.org/downloads
I have added the driver on the path as follows on my centos server where jenkins is installed:
/opt/chromedriver
Then in the code for the driver to load in the test is as follows:
System.setProperty("webdriver.chrome.driver",
"/opt/chromedriver");
Based on the online resource it looks like an incompatibility issue between the driver and the browser but I don't how how to check it.
Can anyone point me out what I am doing wrong please?