Home  >  Article  >  Backend Development  >  How to Suppress the "USB: usb_device_handle_win.cc:1020 Failed to Read Descriptor from Node Connection" Error in Selenium with ChromeDriver v87 on Windows 10?

How to Suppress the "USB: usb_device_handle_win.cc:1020 Failed to Read Descriptor from Node Connection" Error in Selenium with ChromeDriver v87 on Windows 10?

DDD
DDDOriginal
2024-11-11 22:54:03513browse

How to Suppress the

USB: usb_device_handle_win.cc:1020 Failed to Read Descriptor from Node Connection Error with ChromeDriver v87 / Chrome v87 Using Selenium on Windows 10

Problem:

After upgrading to ChromeDriver v87 and Chrome v87, users encounter the following error when running Selenium tests:

[ERROR:device_event_log_impl.cc(211)] ... Failed to read descriptor from node connection: A device attached to the system is not functioning. (0x1F)

Solution:

This error can be suppressed by adding the following experimental option to the webdriver.ChromeOptions() object:

options.add_experimental_option('excludeSwitches', ['enable-logging'])

Updated Code Block:

from selenium import webdriver

options = webdriver.ChromeOptions() 
options.add_argument("start-maximized")
options.add_experimental_option('excludeSwitches', ['enable-logging'])
driver = webdriver.Chrome(options=options, executable_path=r'C:\WebDrivers\chromedriver.exe')
driver.get('https://www.google.com/')

By excluding the enable-logging switch, the error messages will no longer be displayed in the console, allowing tests to run without interruption.

The above is the detailed content of How to Suppress the "USB: usb_device_handle_win.cc:1020 Failed to Read Descriptor from Node Connection" Error in Selenium with ChromeDriver v87 on Windows 10?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn