Skip to content

Commit c95d29c

Browse files
committed
Merge branch 'master' of github.com:rtomac/robotframework-selenium2library
2 parents 6d25d8d + 47991a7 commit c95d29c

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/Selenium2Library/keywords/_screenshot.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,11 @@ def capture_page_screenshot(self, filename=None):
2424
background leaking when the page layout is somehow broken.
2525
"""
2626
path, link = self._get_screenshot_paths(filename)
27-
self._current_browser().save_screenshot(path)
27+
28+
if hasattr(self._current_browser(), 'get_screenshot_as_file'):
29+
self._current_browser().get_screenshot_as_file(path)
30+
else:
31+
self._current_browser().save_screenshot(path)
2832

2933
# Image is shown on its own row and thus prev row is closed on purpose
3034
self._html('</td></tr><tr><td colspan="3"><a href="%s">'

0 commit comments

Comments
 (0)