Fixed the usage information in documentation of "save_screenshot".
"save_screenshot" method was assigned from "get_screenshot_as_file"
as result of that it's usage information was
"driver.get_screenshot_as_file('/Screenshots/foo.png')" which is wrong.
So I defined a separate method which is calling
"get_screenshot_as_file" but with it's correct usage information as
"driver.save_screenshot('/Screenshots/foo.png')"
@@ -837,7 +837,18 @@ class WebDriver(object):
del png
return True
- save_screenshot = get_screenshot_as_file
+ def save_screenshot(self, filename):
+ """
+ Gets the screenshot of the current window. Returns False if there is
+ any IOError, else returns True. Use full paths in your filename.
+
+ :Args:
+ - filename: The full path you wish to save your screenshot to.
+
+ :Usage:
+ driver.save_screenshot('/Screenshots/foo.png')
+ """
+ return self.get_screenshot_as_file(filename)
def get_screenshot_as_png(self):
"""
