简体   繁体   中英

unknown error: cannot find Chrome binary while attempting Maven test on Jenkins using ChromeDriver Chrome through Selenium

Had been trying to configure and have met with a lot of trouble, tried a lot of attempt but failed.

  • chromedriver=2.30.477691
  • Chrome 59.0.3071.115
  • Build info: version: '3.14.0'
  • Selenium 3.4
  • java.version: '1.8.0_121'
  • Linux 3.10.0-229.4.2.el7.x86_64 x86_64

Error:

unknown error: cannot find Chrome binary   (Driver info: chromedriver=2.30.477691 (6ee44a7247c639c0703f291d320bdf05c1531b57),platform=Linux 3.10.0-229.4.2.el7.x86_64 x86_64) (WARNING: The server did not provide any stacktrace information) Command duration or timeout: 59 milliseconds Build info: version: '3.14.0', revision: 'aacccce0', time: '2018-08-02T20:19:58.91Z' System info: host: '8f5b40c32460', ip: 'x', os.name: 'Linux', os.arch: 'amd64', os.version: '3.10.0-229.4.2.el7.x86_64', java.version: '1.8.0_121' Driver info: driver.version: ChromeDriver

This error message...

unknown error: cannot find Chrome binary   (Driver info: chromedriver=2.30.477691 (6ee44a7247c639c0703f291d320bdf05c1531b57),platform=Linux 3.10.0-229.4.2.el7.x86_64 x86_64) (WARNING: The server did not provide any stacktrace information) Command duration or timeout: 59 milliseconds Build info: version: '3.14.0', revision: 'aacccce0', time: '2018-08-02T20:19:58.91Z' System info: host: '8f5b40c32460', ip: 'x', os.name: 'Linux', os.arch: 'amd64', os.version: '3.10.0-229.4.2.el7.x86_64', java.version: '1.8.0_121' Driver info: driver.version: ChromeDriver

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

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

  • You are using chromedriver=2.30
  • Release Notes of chromedriver=2.30 clearly mentions the following :

Supports Chrome v58-60

  • You are using chrome=59.0
  • Your Selenium Client version is 3.14.0 of 2018-08-02T20:19:58.91Z which is almost 2.5 years older.
  • Your JDK version is 1.8.0_121 which is pretty ancient.

So there is a clear mismatch between JDK v8u121 , Selenium Client v3.14.1 , ChromeDriver v2.30 and the Chrome Browser v59.0


Solution

Ensure that:

  • JDK is upgraded to current levels JDK 8u232 .
  • Selenium is upgraded to current levels Version 3.141.59 .
  • ChromeDriver is updated to current ChromeDriver v79.0.3945.36 level.
  • Chrome is updated to current Chrome Version 79.0 level. (as per ChromeDriver v79.0 release notes )
  • Clean your Project Workspace through your IDE and Rebuild your project with required dependencies only.
  • 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 as non-root user.
  • Always invoke driver.quit() within tearDown(){} method to close & destroy the WebDriver and Web Client instances gracefully.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM