Is Chrome installation needed or only chromedriver when using Selenium? Is Chrome installation needed or only chromedriver when using Selenium? selenium selenium

Is Chrome installation needed or only chromedriver when using Selenium?


This error message...

Exception occurred: Failed initializing web driver: Message: unknown error: cannot find Chrome binary  (Driver info: chromedriver=2.40.565498 (ea082db3280dd6843ebfb08a625e3eb905c4f5ab),platform=Windows NT 10.0.14393 x86_64)

...implies that the ChromeDriver was unable to find the Chrome binary while trying to initiate a new new Browsing Context i.e. Chrome Browser session.


As per the documentation with in the wiki page of ChromeDriver:

  • ChromeDriver is a standalone server which earlier implemented the WebDriver's wire protocol but slowly and gradually shifting it's implementation as per WebDriver standard.

  • The ChromeDriver consists of three separate pieces.

    • There is the browser itself i.e. chrome
    • The language bindings provided by the Selenium project i.e. the driver
    • An executable downloaded from the Chromium project which acts as a bridge between chrome and the driver which is called chromedriver and we refer to it as the server.
  • In generic scenarios the server expects you to have Chrome installed in the default location for each system:
    • Linux: /usr/bin/google-chrome 1
    • Mac: /Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome
    • Windows XP: %HOMEPATH%\Local Settings\Application Data\Google\Chrome\Application\chrome.exe
    • Windows Vista and newer: C:\Users\%USERNAME%\AppData\Local\Google\Chrome\Application\chrome.exe

Note: 1: For Linux systems, the ChromeDriver expects /usr/bin/google-chrome to be a symlink to the actual Chrome binary.

You can find a detailed discussion on overriding the default Chrome binary location in WebDriverException: unknown error: cannot find Chrome binary error with Selenium in Python for older versions of Google Chrome


Solution

So ideally to execute your tests using ChromeDriver / Chrome combo you need to:


Reference

You can find a detailed discussion in:


Users provided relevant link to confirm that, "YES" a full Chrome installation is needed in addition to the actual chromedriver.

Link: https://github.com/SeleniumHQ/selenium/wiki/ChromeDriver