-
Notifications
You must be signed in to change notification settings - Fork 764
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Keyword capture_page_screenshot fails when using Remote WebDriver #43
Comments
fixed in korda's fork- korda@0c52e07 |
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? |
I am also curious about the status of this fix, especially since it seems like rtomac hasn't been active in over a month. |
I can confirm that @ombre42's patch fixes the issue (and i get screenshots in reports) |
Merged with #80. This fix will be in the Selenium2Library 1.1 release. |
Original source for this fix: korda@0c52e07 Original issue report: #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)
The text was updated successfully, but these errors were encountered: