Skip to content

Commit

Permalink
[py] need to log both stdout and stderr from selenium manager
Browse files Browse the repository at this point in the history
  • Loading branch information
titusfortner committed Dec 2, 2022
1 parent 2502e96 commit ac94275
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion py/selenium/webdriver/common/selenium_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ def run(args: Tuple[str, str, str]) -> str:
stdout = completed_proc.stdout.decode("utf-8").rstrip("\n")
stderr = completed_proc.stderr.decode("utf-8").rstrip("\n")
if completed_proc.returncode:
raise SeleniumManagerException(f"Selenium manager failed for: {command}. {stderr}")
raise SeleniumManagerException(f"Selenium manager failed for: {command}.\n{stdout}{stderr}")
else:
# selenium manager exited 0 successfully, parse the executable path from stdout.
return stdout.split("\t")[-1].strip()
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def test_non_supported_browser_raises_sme():


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

0 comments on commit ac94275

Please sign in to comment.