Skip to content

Commit

Permalink
[py] Make get_screenshot_as_file() work with pathlib.Paths (Seleniu…
Browse files Browse the repository at this point in the history
…mHQ#11095)

Make `get_screenshot_as_file()` work with pathlib.Paths
  • Loading branch information
NickCrews committed Oct 8, 2022
1 parent 86ba7d2 commit 3d6950a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion py/selenium/webdriver/remote/webdriver.py
Original file line number Diff line number Diff line change
Expand Up @@ -920,7 +920,7 @@ def get_screenshot_as_file(self, filename) -> bool:
driver.get_screenshot_as_file('/Screenshots/foo.png')
"""
if not filename.lower().endswith(".png"):
if not str(filename).lower().endswith(".png"):
warnings.warn(
"name used for saved screenshot does not match file " "type. It should end with a `.png` extension",
UserWarning,
Expand Down

0 comments on commit 3d6950a

Please sign in to comment.