1

I have a problem with the last chromedriver. Fails every time with the following error:

Starting ChromeDriver 2.45.615279 (12b89733300bd268cff3b78fc76cb8f3a7cc44e5) on port 2393 Only local connections are allowed. org.openqa.selenium.WebDriverException: unknown error: Chrome failed to start: exited abnormally

The browser version is

Version 71.0.3578.98 (Official Build) (64-bit)

When I run from eclipse everything works OK, does not fail. Fails only when I run from Jenkins or Linux console. The chromedriver process remains hanged on Linux. Is there a solution for this?

Mate Mrše
  • 7,997
  • 10
  • 40
  • 77
corny
  • 61
  • 1
  • 12

2 Answers2

2

Try adding the --no-sandbox flag:

ChromeOptions ChromeOptions = new ChromeOptions();
ChromeOptions.addArguments("--headless", "window-size=1024,768", "--no-sandbox");
driver = new ChromeDriver(ChromeOptions);

Or, some were helped by --single-process option, as suggested here.

Mate Mrše
  • 7,997
  • 10
  • 40
  • 77
0

The fix is hidden in the answer above. For me, the only option that was needed to fix this issue was to run chrome in a headless mode.

ChromeOptions options = new ChromeOptions().setHeadless(true); 
WebDriver driver = new ChromeDriver(options);

Results: Now tests run successfully, without any errors.

Pramod Yadav
  • 467
  • 8
  • 14