Skip to content

Commit ac94275

Browse files
committed
[py] need to log both stdout and stderr from selenium manager
1 parent 2502e96 commit ac94275

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

py/selenium/webdriver/common/selenium_manager.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ def run(args: Tuple[str, str, str]) -> str:
9090
stdout = completed_proc.stdout.decode("utf-8").rstrip("\n")
9191
stderr = completed_proc.stderr.decode("utf-8").rstrip("\n")
9292
if completed_proc.returncode:
93-
raise SeleniumManagerException(f"Selenium manager failed for: {command}. {stderr}")
93+
raise SeleniumManagerException(f"Selenium manager failed for: {command}.\n{stdout}{stderr}")
9494
else:
9595
# selenium manager exited 0 successfully, parse the executable path from stdout.
9696
return stdout.split("\t")[-1].strip()

py/test/selenium/webdriver/common/selenium_manager_tests.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ def test_non_supported_browser_raises_sme():
2828

2929

3030
def test_stderr_is_propagated_to_exception_messages():
31-
msg = 'Selenium manager failed for.*Error: "Invalid browser/driver name"'
31+
msg = 'Selenium manager failed for:.* --browser foo\.\nERROR\tInvalid browser/driver name'
3232
with pytest.raises(SeleniumManagerException, match=msg):
3333
manager = SeleniumManager()
3434
binary = manager.get_binary()

0 commit comments

Comments
 (0)