Skip to content
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

Closed
ombre42 opened this issue Mar 26, 2012 · 6 comments
Closed

Keyword capture_page_screenshot fails when using Remote WebDriver #43

ombre42 opened this issue Mar 26, 2012 · 6 comments
Milestone

Comments

@ombre42
Copy link
Contributor

ombre42 commented Mar 26, 2012

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)

@ombre42
Copy link
Contributor Author

ombre42 commented May 5, 2012

fixed in korda's fork- korda@0c52e07
thank you and sorry I didn't use GFM markup

@ombre42 ombre42 closed this as completed May 5, 2012
@ombre42 ombre42 reopened this May 31, 2012
@adwu73
Copy link
Contributor

adwu73 commented 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
Copy link

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
Copy link
Contributor

peritus commented Jul 23, 2012

I can confirm that @ombre42's patch fixes the issue (and i get screenshots in reports)

@peritus
Copy link
Contributor

peritus commented Jul 23, 2012

Created a pull request that includes @korda's patch for easy merging:

#80

@emanlove
Copy link
Member

Merged with #80. This fix will be in the Selenium2Library 1.1 release.

zephraph pushed a commit that referenced this issue Aug 11, 2015
Original source for this fix:

  korda@0c52e07

Original issue report:

  #43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants