1

I used Windows 10 ChromeDriver with Selenium for several months and everything worked fine with my Python application. Today when I used may application I got the following error:

This version of ChromeDriver only supports Chrome version 78

I checked my chrome version and indeed it is now version 80 and not 78 anymore.

I downloaded ChromeDriver 80.0.3987.106. However, when I clicked on the chromdriver.exe, the command window opened and came with the following message:

Starting ChromeDriver 80.0.3987.106 ... on port 9515
Only local connections are allowed.
Please protect ports used by ChromeDriver and related test frameworks to prevent access by malicious code.

After displaying the above message, the command window got stuck and did not accept any keyboard inputs.

eyllanesc
  • 235,170
  • 19
  • 170
  • 241
Menachem
  • 265
  • 1
  • 4
  • 17

1 Answers1

0

I believe this is normal behavior. Instead of clicking or launching driver directly from terminal, I think you should call the driver from your code like explained in the Getting started tutorial:

import time
from selenium import webdriver

driver = webdriver.Chrome('/path/to/chromedriver')  # Optional argument, if not specified will search path.
driver.get('http://www.google.com/');
time.sleep(5) # Let the user actually see something!
search_box = driver.find_element_by_name('q')
search_box.send_keys('ChromeDriver')
search_box.submit()
time.sleep(5) # Let the user actually see something!
driver.quit()

The tutorial also explains how to manage lifecycle of the driver, so you don't necessarily have to launch it each time, but instead use it as a background service (server) instead.

I think you should first try the former option, then when you feel comfortable, and if you feel the need, move on to using the driver as a server.

rolf82
  • 1,531
  • 1
  • 5
  • 15
  • Thank you for your reply. What you suggest assumes that the ChromeDriver is already installed. Not being able to install the driver using the command window is not a normal behavior because this is how I installed it initially. In addition the downloaded ChromeDriver opens the command window automatically after you unzip it and click on the chromdriver.exe. – Menachem Feb 29 '20 at 21:02
  • I don't understand... Chromedriver is a separate executable, there is no "installation". Once you downloaded it, it is installed. Being able to launch it and the output you provided just proves that you have it. You should be able to run the example code, by filling the right path to the driver. Launching chromedriver.exe is not supposed to install it, but just to launch it and that's what it seems to do. – rolf82 Feb 29 '20 at 21:06
  • Everything works now fine. I had to replace the Chrome driver executable with the newer version that supports chrome 80. Once I did it everything started to work fine as before. That said, I will definitely take your advise to add the code that manages the life cycle of the driver so this issue does not happen again. Thanks a lot for your help. – Menachem Feb 29 '20 at 21:28