0

I have configured my Selenium Hub with 2 Chrome nodes in Selenium 4. When I run the command minikube service selenium-hub --url I get the URLs like http://127.0.0.1:58317 and I am able to see the hub-node configuration up and running correctly. I wrote a simple java code to test this configuration. However, when I run my run it fails. My code is -

    ChromeOptions chromeOptions = new ChromeOptions();

    chromeOptions.addArguments("--headless",
            "--disable-gpu",
            "--window-size=1920,1200",
            "--ignore-certificate-errors",
            "--disable-extensions",
            "--no-sandbox",
            "--disable-dev-shm-usage",
            "--allow-insecure-localhost",
            "allow-running-insecure-content");


    WebDriver driver = new RemoteWebDriver(new URL("http://127.0.0.1:58317/wd/hub"), chromeOptions);
    
    System.out.println("******************** STARTED TEST EXECUTION ********************************");
    driver.manage().window().maximize();
    driver.get("https://www.google.com/");
    driver.close();

When I run the test, I am getting this error -

INFO: Using OpenTelemetry for tracing
Exception in thread "main" org.openqa.selenium.SessionNotCreatedException: Could not start a new session. Response code 500. Message: Could not start a new session. Could not start a new session. Error while creating session with the driver service. Stopping driver service: Could not start a new session. Response code 500. Message: unknown error: Chrome failed to start: crashed.
  (chrome not reachable)
  (The process started from chrome location /usr/bin/google-chrome is no longer running, so ChromeDriver is assuming that Chrome has crashed.)
Build info: version: '4.0.0', revision: '3a21814679'
System info: host: 'selenium-node-chrome-78784d568c-mqlc7', ip: '172.17.0.2', os.name: 'Linux', os.arch: 'amd64', os.version: '5.15.49-linuxkit', java.version: '11.0.11'
Driver info: driver.version: unknown
Build info: version: '4.0.0', revision: '3a21814679'
System info: host: 'selenium-node-chrome-78784d568c-mqlc7', ip: '172.17.0.2', os.name: 'Linux', os.arch: 'amd64', os.version: '5.15.49-linuxkit', java.version: '11.0.11'
Driver info: driver.version: unknown
Build info: version: '4.0.0', revision: '3a21814679'
System info: host: 'selenium-hub-66f9f7d979-wqslh', ip: '172.17.0.3', os.name: 'Linux', os.arch: 'amd64', os.version: '5.15.49-linuxkit', java.version: '11.0.11'
Driver info: driver.version: unknown
Build info: version: '4.0.0', revision: '3a21814679'
System info: host: 'UM01416', ip: '2a02:1210:3edc:4a00:e5da:1807:9574:1abc%en0', os.name: 'Mac OS X', os.arch: 'aarch64', os.version: '12.6.1', java.version: '11.0.17'
Driver info: org.openqa.selenium.remote.RemoteWebDriver

I am attaching an image of my Selenium Hub configuration. enter image description here

MuCh
  • 103
  • 1
  • 9

0 Answers0