From 20efab0d487f04a4faa99652db82aea4a1b720c4 Mon Sep 17 00:00:00 2001 From: Filip Noetzel Date: Mon, 23 Jul 2012 16:49:08 +0200 Subject: [PATCH] Fix Capture Page Screenshot for RemoteWebDriver Original source for this fix: https://github.com/korda/robotframework-selenium2library/commit/0c52e076c335f6804899fee9ea7d1b2a7904773f Original issue report: https://github.com/rtomac/robotframework-selenium2library/issues/43 --- src/Selenium2Library/keywords/_screenshot.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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(''