Wednesday, November 4, 2009
If you get this error: 0x80520001 (NS_ERROR_FILE_UNRECOGNIZED_PATH) [nsILocalFile.initWithPath] foll. is the solution:
selenium.capture_entire_page_screenshot works only with absolute path for eg.,
self.sel.capture_entire_page_screenshot("C:\\out.png,"background=#CCFFDD") - for windows
self.sel.capture_entire_page_screenshot("/Users/abc/tests/testresults/out.png,"background=#CCFFDD") - for Mac
Alternatively,capture_screenshot can be used which takes relative path. Tested the foll. in both Mac and windows. Drawback is, it doesn't get the entire page. Just gets the visible portion of the webpage :(
self.sel.capture_screenshot("testresults/out.png")
No comments:
Post a Comment