Skip to content

[πŸ› Bug]: DeprecationWarning raised by default init args of Chrome webdriverΒ #14687

@drammock

Description

@drammock

What happened?

#13286 introduced a DeprecationWarning:

setting remote_server_addr in RemoteConnection() is deprecated, set in ClientConfig instance instead

We're seeing this warning on a very simple use case that uses only default webdriver options except for headless. Seems like the culprit is probably this line:

remote_server_addr=self.service.service_url,

but I'm unfamiliar with your codebase so I'm not sure what the right fix would be.

How can we reproduce the issue?

our usage looks like this:


from selenium import webdriver
options = webdriver.ChromeOptions()
options.add_argument("--headless=new")
driver = webdriver.Chrome(options=options)  # <- this line triggers the DeprecationWarning


(simplified from https://github.com/mne-tools/mne-python/blob/f00deb44e2996a3b707c3f0399cfa0d8b842c566/doc/sphinxext/contrib_avatars.py#L21-L29)

Relevant log output

Traceback (most recent call last):
  File "/home/circleci/python_env/lib/python3.12/site-packages/sphinx/events.py", line 404, in emit
    results.append(listener.handler(self.app, *args))
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/circleci/project/doc/sphinxext/contrib_avatars.py", line 29, in generate_contrib_avatars
    driver = webdriver.Chrome(options=options)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/circleci/python_env/lib/python3.12/site-packages/selenium/webdriver/chrome/webdriver.py", line 45, in __init__
    super().__init__(
  File "/home/circleci/python_env/lib/python3.12/site-packages/selenium/webdriver/chromium/webdriver.py", line 57, in __init__
    executor = ChromiumRemoteConnection(
               ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/circleci/python_env/lib/python3.12/site-packages/selenium/webdriver/chromium/remote_connection.py", line 33, in __init__
    super().__init__(
  File "/home/circleci/python_env/lib/python3.12/site-packages/selenium/webdriver/remote/remote_connection.py", line 302, in __init__
    warnings.warn(
DeprecationWarning: setting remote_server_addr in RemoteConnection() is deprecated, set in ClientConfig instance instead


(from here: https://app.circleci.com/pipelines/github/mne-tools/mne-python/25647/workflows/8fe55c7b-0c19-44dc-a007-9cab0cb274a5/jobs/69427?invite=true#step-142-1157_34)

Operating System

Linux

Selenium version

Python, 4.26.0 (https://app.circleci.com/pipelines/github/mne-tools/mne-python/25647/workflows/8fe55c7b-0c19-44dc-a007-9cab0cb274a5/jobs/69427?invite=true#step-118-9272_35)

What are the browser(s) and version(s) where you see this issue?

sadly our CI log doesn't show that info

What are the browser driver(s) and version(s) where you see this issue?

sadly our CI log doesn't show that info

Are you using Selenium Grid?

n/a

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-pyPython BindingsI-defectSomething is not working as intended

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions