You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Keyword capture_page_screenshot fails when using Remote WebDriver #43
When using a Remote WebDriver, call keyword Capture Page Screenshot. Result:
FAIL AttributeError: 'WebDriver' object has no attribute 'save_screenshot'
The remote driver in the Selenium Python bindings defines a method called get_screenshot_as_file instead of save_screenshot, but they perform the same action and have the same signature.
A simple workaround for this:
on Line 27 of keywords/_screenshot.py,
replace:
self._current_browser().save_screenshot(path)
with:
if hasattr(self._current_browser(), 'get_screenshot_as_file'):
self._current_browser().get_screenshot_as_file(path)
else:
self._current_browser().save_screenshot(path)
Activity
ombre42 commentedon May 5, 2012
fixed in korda's fork- korda@0c52e07
thank you and sorry I didn't use GFM markup
adwu73 commentedon Jul 6, 2012
I have reproduced the issue, and tested the fix. It works. can someone help to merge this into the fork? It seems this fix is not in 1.0.1 yet?
hbmartin commentedon Jul 19, 2012
I am also curious about the status of this fix, especially since it seems like rtomac hasn't been active in over a month.
peritus commentedon Jul 23, 2012
I can confirm that @ombre42's patch fixes the issue (and i get screenshots in reports)
peritus commentedon Jul 23, 2012
Created a pull request that includes @korda's patch for easy merging:
#80
emanlove commentedon Sep 25, 2012
Merged with #80. This fix will be in the Selenium2Library 1.1 release.
Fix Capture Page Screenshot for RemoteWebDriver