WebDriverException: unknown error: Chrome failed to start: exited abnormally error running Selenium Grid on Server using ChromeDriver and Chrome
Asked Answered
M

1

2

Good evening,

I tried to run my automated tests on a server with Eclipse / Selenium and TestNG. So far the configuration of Selenium Grid worked fine. I got the response:

23:02:55.068 INFO - Selenium Grid hub is up and running
23:03:30.488 INFO - Registered a node http://81.169.xxx.xxx:5555 <br>
23:05:25.423 INFO - Registering the node to the hub: http://81.169.xxx.xxx:4444/grid/register
23:05:25.432 INFO - The node is registered to the hub and ready to use

Here's my example code:

@Test
public void executeOnServer() throws MalformedURLException {
    System.out.println("Test started");
    DesiredCapabilities dcp = new DesiredCapabilities();
    dcp.setBrowserName("chrome");
    dcp.setPlatform(Platform.ANY);
    WebDriver driver = new RemoteWebDriver(new URL("http://81.169.xxx.xxx:5555/wd/hub/"), dcp);
    driver.manage().window().maximize();
    driver.get("https://google.de");
    driver.quit();
}

Unfortunately I got the error:

    [RemoteTestNG] detected TestNG version 6.14.3
Test started
FAILED: executeOnServer
org.openqa.selenium.WebDriverException: unknown error: **Chrome failed to start: exited abnormally.**
  (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.)
Build info: version: '3.4.0', revision: 'unknown', time: 'unknown'
System info: host: 'h28xxxxx.stratoserver.net', ip: '81.169.xxx.xxx', os.name: 'Linux', os.arch: 'amd64', os.version: '4.15.0', java.version: '1.8.0_252'
Driver info: driver.version: ChromeDriver
remote stacktrace: #0 0x559967ec9ea9 <unknown>

The path to the chromedriver is:

usr/local/bin/chromedriver 

Installed version:

https://chromedriver.storage.googleapis.com/index.html?path=**84.0.4147.30**/chromedriver_linux64.zip

Do you have any idea how I could fix the error? Had a look at different sites with this error, no solution is working for me.

Moonfish answered 28/7, 2020 at 21:30 Comment(0)
L
1

This error message...

Test started
FAILED: executeOnServer
org.openqa.selenium.WebDriverException: unknown error: **Chrome failed to start: exited abnormally.**
  (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.)
Build info: version: '3.4.0', revision: 'unknown', time: 'unknown'
System info: host: 'h28xxxxx.stratoserver.net', ip: '81.169.xxx.xxx', os.name: 'Linux', os.arch: 'amd64', os.version: '4.15.0', java.version: '1.8.0_252'
Driver info: driver.version: ChromeDriver
remote stacktrace: #0 0x559967ec9ea9 <unknown>

...implies that the ChromeDriver was unable to initiate/spawn a new Browsing Context i.e. Chrome Browser session.

Your main issue is the incompatibility between the version of the binaries you are using as follows:

  • You are using chromedriver=84.0
  • Possibly you are using the latest chrome=84.0
  • Your Selenium Client version is 3.4.0 of revision: 'unknown', time: 'unknown'

So that implies the ChromeDriver is unable to interact with the Selenium bindings as there is a clear mismatch between Selenium v3.4.0 and the ChromeDriver v84.0


Solution

Ensure that:

  • Selenium is upgraded to current levels Version 3.141.59.
  • ChromeDriver is updated to current ChromeDriver v84.0 level.
  • Chrome is updated to current Chrome Version 84.0 level. (as per ChromeDriver v84.0 release notes)
  • If your base Web Client version is too old, then uninstall it and install a recent GA and released version of Web Client.
  • Clean your Project Workspace through your IDE and Rebuild your project with required dependencies only.
  • Take a System Reboot.
  • Execute your @Test as non-root user.
  • Always invoke driver.quit() within tearDown(){} method to close & destroy the WebDriver and Web Client instances gracefully.
Latonia answered 28/7, 2020 at 21:57 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.