Search code examples
javaselenium-webdriverwebdriver

Selenium Cucumber Maven framework - driver not working on VM of my company


Hello I have this problem. I'm trying to run selenium tests on ubuntu machine of my company via Jenkins build started but it looks like there is some version mismatch chrome: 108.0.5359.124 and chromedriver 108.0.5359.71 but there is nothing on internet like chromedriver:108.0.5359.124. My log output:

(unknown error: 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: 'pdbnhpsron043', ip: '10.102.8.74' Build info: version: '4.9.0', revision: 'd7057100a6' System info: os.name: 'Linux', os.arch: 'amd64', os.version: '5.15.0-60-generic', java.version: '17.0.7' Driver info: org.openqa.selenium.chrome.ChromeDriver Command: [null, newSession {capabilities=[Capabilities {browserName: chrome, goog:chromeOptions: {args: [--remote-allow-origins=*, --disable-

I try running it with driver 109 it didn't helped at all. I tried to run it with :

options.addArguments("--remote-allow-origins=\*"); 
options.addArguments("--disable-dev-shm-usage"); 
options.addArguments("--ignore-ssl-errors=yes"); 
options.addArguments("--ignore-certificate-errors"); 

Also problem is that I don't have access to VM so I cannot manipulate it


Solution

  • disable-dev-shm-usage argument isn't effective unless you are using the --no-sandbox argument as well. So try to remove it.

    Again, the argument is --remote-allow-origins=* instead of --remote-allow-origins=\* which you mentioned. So remove it.

    Making the above mentioned adjustments execute your code.