diff --git a/py/selenium/webdriver/common/selenium_manager.py b/py/selenium/webdriver/common/selenium_manager.py index a4a8edd5366fe..b7c7661dcecf8 100644 --- a/py/selenium/webdriver/common/selenium_manager.py +++ b/py/selenium/webdriver/common/selenium_manager.py @@ -25,6 +25,7 @@ from pathlib import Path from selenium.common import WebDriverException +from selenium.webdriver import __version__ as VERSION logger = logging.getLogger(__name__) @@ -36,7 +37,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. @@ -49,6 +50,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") diff --git a/py/test/selenium/webdriver/common/selenium_manager_tests.py b/py/test/selenium/webdriver/common/selenium_manager_tests.py index 13edd5577ce7f..27ebb8db875dd 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)