org.openqa.selenium.WebDriverException: unknown error: Chrome failed to start: crashed (headless chrome)

后端 未结 1 1494
不知归路
不知归路 2020-12-12 04:07

I am running headless chrome on centos, with headless chrome version 2.38, and google-chrome-stable version 67.0

System.setProperty(\"webdriver.chrome.driver         


        
相关标签:
1条回答
  • 2020-12-12 04:42

    This error message...

    org.openqa.selenium.WebDriverException: unknown error: Chrome failed to start: crashed
    

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

    As you are using Headless Chrome on CentOS it is worth to mention that as per the discussion Getting Started with Headless Chrome --disable-gpu is Temporarily needed if running on Windows.

    --disable-gpu \                # Temporarily needed if running on Windows.
    

    However, your main issue is the incompatibility between the version of the binaries you are using as follows:

    • You are using chromedriver=2.38
    • You are using chrome=67.0
    • Your Selenium Client version is 3.6.0 of 2017-09-27T15:28:36.4Z which is almost a year older.
    • Your JDK version is 1.8.0_101 which is pretty ancient.

    So there is a clear mismatch between the JDK v8u101 , Selenium Client v3.6.0 , ChromeDriver v2.38 and the Chrome Browser v67.0

    Solution

    • Upgrade JDK to recent levels JDK 8u171.
    • Upgrade Selenium to current levels Version 3.12.0.
    • Upgrade ChromeDriver to current ChromeDriver v2.40 level.
    • Keep Chrome version between Chrome v66-68 levels. (as per ChromeDriver v2.40 release notes)
    • Clean your Project Workspace through your IDE and Rebuild your project with required dependencies only.
    • Use CCleaner tool to wipe off all the OS chores before and after the execution of your Test Suite.
    • If your base Web Client version is too old, then uninstall it through Revo Uninstaller and install a recent GA and released version of Web Client.
    • Take a System Reboot.
    • Execute your @Test.
    • Always invoke driver.quit() within tearDown(){} method to close & destroy the WebDriver and Web Client instances gracefully.
    0 讨论(0)
提交回复
热议问题