Skip to content

Commit 3d6950a

Browse files
authored
[py] Make get_screenshot_as_file() work with pathlib.Paths (#11095)
Make `get_screenshot_as_file()` work with pathlib.Paths
1 parent 86ba7d2 commit 3d6950a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

py/selenium/webdriver/remote/webdriver.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -920,7 +920,7 @@ def get_screenshot_as_file(self, filename) -> bool:
920920
921921
driver.get_screenshot_as_file('/Screenshots/foo.png')
922922
"""
923-
if not filename.lower().endswith(".png"):
923+
if not str(filename).lower().endswith(".png"):
924924
warnings.warn(
925925
"name used for saved screenshot does not match file " "type. It should end with a `.png` extension",
926926
UserWarning,

0 commit comments

Comments
 (0)