diff --git a/src/Selenium2Library/keywords/_screenshot.py b/src/Selenium2Library/keywords/_screenshot.py index c6ddf1e4a..2a06acdb9 100644 --- a/src/Selenium2Library/keywords/_screenshot.py +++ b/src/Selenium2Library/keywords/_screenshot.py @@ -24,7 +24,11 @@ def capture_page_screenshot(self, filename=None): background leaking when the page layout is somehow broken. """ path, link = self._get_screenshot_paths(filename) - self._current_browser().save_screenshot(path) + + if hasattr(self._current_browser(), 'get_screenshot_as_file'): + self._current_browser().get_screenshot_as_file(path) + else: + self._current_browser().save_screenshot(path) # Image is shown on its own row and thus prev row is closed on purpose self._html('