From 96466aaf72e6047e77d73c6a65bb3006309944a6 Mon Sep 17 00:00:00 2001 From: Corey Goldberg <1113081+cgoldberg@users.noreply.github.com> Date: Sun, 30 Nov 2025 15:16:28 -0500 Subject: [PATCH 1/2] [py] Add --selenium-version to Selenium Manager args --- py/selenium/webdriver/common/selenium_manager.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/py/selenium/webdriver/common/selenium_manager.py b/py/selenium/webdriver/common/selenium_manager.py index 51c2723c4ac35..bfce11c2015a3 100644 --- a/py/selenium/webdriver/common/selenium_manager.py +++ b/py/selenium/webdriver/common/selenium_manager.py @@ -14,6 +14,7 @@ # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. + import json import logging import os @@ -24,6 +25,8 @@ from pathlib import Path from selenium.common import WebDriverException +from selenium.webdriver import __version__ as VERSION + logger = logging.getLogger(__name__) @@ -35,7 +38,7 @@ class SeleniumManager: """ def binary_paths(self, args: list) -> dict: - """Determines the locations of the requested assets. + """Builds the Selenium Manager command line argument list and runs it. Args: args: the commands to send to the selenium manager binary. @@ -48,6 +51,8 @@ def binary_paths(self, args: list) -> dict: args.append("--debug") args.append("--language-binding") args.append("python") + args.append("--selenium-version") + args.append(VERSION) args.append("--output") args.append("json") From d349e835903eb67ec51768b22f35e61425fb9d18 Mon Sep 17 00:00:00 2001 From: Corey Goldberg <1113081+cgoldberg@users.noreply.github.com> Date: Mon, 15 Dec 2025 20:50:26 -0500 Subject: [PATCH 2/2] Fix test and formatting --- py/selenium/webdriver/common/selenium_manager.py | 1 - .../webdriver/common/selenium_manager_tests.py | 10 +++++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/py/selenium/webdriver/common/selenium_manager.py b/py/selenium/webdriver/common/selenium_manager.py index bfce11c2015a3..59c06b965a056 100644 --- a/py/selenium/webdriver/common/selenium_manager.py +++ b/py/selenium/webdriver/common/selenium_manager.py @@ -27,7 +27,6 @@ from selenium.common import WebDriverException from selenium.webdriver import __version__ as VERSION - logger = logging.getLogger(__name__) diff --git a/py/test/selenium/webdriver/common/selenium_manager_tests.py b/py/test/selenium/webdriver/common/selenium_manager_tests.py index 5a70faab1e499..dd958f9379bcc 100644 --- a/py/test/selenium/webdriver/common/selenium_manager_tests.py +++ b/py/test/selenium/webdriver/common/selenium_manager_tests.py @@ -38,7 +38,15 @@ def test_gets_results(monkeypatch): SeleniumManager().binary_paths([]) mock_get_binary.assert_called_once() - expected_run_args = ["/path/to/sm", "--language-binding", "python", "--output", "json"] + expected_run_args = [ + "/path/to/sm", + "--language-binding", + "python", + "--selenium-version", + selenium.__version__, + "--output", + "json", + ] mock_run.assert_called_once_with(expected_run_args)