3

I upgraded my chromedriver from v.2.35 to v.2.42. I have just downloaded v.2.42 and added to global path

export PATH=$PATH:/usr/lib/chromedriver

But when I enter in terminal chromedriver, I get

Starting ChromeDriver 2.35.528139 (47ead77cb35ad2a9a83248b292151462a66cd881) on port 9515 Only local connections are allowed. 

I cannot find that version of the driver in filesystem.

My question is how to find out location of this old chromedriver.

Selenium Tests still work, but I don't know which chromedriver version they are using. pip3 and pip do not contain chromedriver.

I would like to find location of all chromedrivers on the system.

timbre timbre
  • 12,648
  • 10
  • 46
  • 77
Maciej.O
  • 103
  • 1
  • 1
  • 7

2 Answers2

5

Response for Windows: (Note: the following works only when chromedriver can be located by path environment variable)

  • command window (or IDE terminal) enter chromedriver (return)
  • you should see something as stated above, 'Starting ChromeDriver 2.35.528139 (47ead77cb35ad2a9a83248b292151462a66cd881) on port 9515 Only local connections are allowed.'
  • Do not close the command window or interrupt the chromedriver process you started
  • open Task Manager and find process 'chromedriver'
  • right click on 'chromedriver' and select 'open file location'

for myself the rogue chromedriver file was in bin of ruby installation.

1

To find out which chromedriver is launched when you run chromedriver command:

  1. Run chromedriver with ampersand at the end to put it in background and when it started, press Enter second time to return to command line:

    $ chromedriver&
    [1] 84039
    $ Starting ChromeDriver 2.38.552518 (183d19265345f54ce39cbb94cf81ba5f15905011) on port 9515 Only local connections are allowed.
    <press Enter again here>
    $ 
    
  2. Previous command shows the PID of the process. Run lsof command for that PID to find the path of that process's executable. For example in my case PID was 84039, so I will run:

    $ lsof -p 84039
    

    and the output will contain the line with the path to your chrome driver. For example for me it was:

    chromedri 84039 user  txt      REG                1,4 11917200     8691417 /usr/local/bin/chromedriver
    

To find all instances of chromedriver on a machine

You need to remember that selenium (especially if launched from Jenkins or other CI tool), is launched in context of a specific user. So make sure when running the following command that you are

  • either in a context of the same user as selenium
  • or you are admin/root account which has access to private directories of all users.

Otherwise you may not find all the results. And then run find command. My preference to run it as root (with sudo):

sudo find / -type f -name chromedriver

The output will contain locations of all chromedrivers in the system, e.g.:

/usr/local/bin/chromedriver
/Users/user/Downloads/chromedriver
timbre timbre
  • 12,648
  • 10
  • 46
  • 77