DeprecationWarning: use options instead of chrome_options error using ChromeDriver and Chrome through Selenium on Windows 10 system

This error message…

DeprecationWarning: use options instead of chrome_options

…implies that in your program you have used chrome_options to initiate a Selenium driven ChromeDriver initiated Browsing Context.

chrome_options is deprecated now and you have to use options instead as well as pass the absolute path of the ChromeDriver along with the extension.


Solution

As you are triggering your tests on a system, effectively you line of code will be:

options = webdriver.ChromeOptions()
options.add_argument('--headless')
driver = webdriver.Chrome(executable_path=r'C:\chromedriver_win32\chromedriver.exe', options=options)

Leave a Comment