Created
November 26, 2013 12:59
-
-
Save thekarel/7657903 to your computer and use it in GitHub Desktop.
Selenium webdriver JS take screenshot -- from http://stackoverflow.com/questions/15902142/webdriverjs-selenium2-from-nodejs-correct-syntax-for-taking-screenshot
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function writeScreenshot(data, name) { | |
name = name || 'ss.png'; | |
var screenshotPath = 'C:\\selenium_local_map\\'; | |
fs.writeFileSync(screenshotPath + name, data, 'base64'); | |
}; | |
driver.takeScreenshot().then(function(data) { | |
writeScreenshot(data, 'out1.png'); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It's not working anymore:
And from the comment:
browser.saveScreenshot() - that's a method from webdriver.io, not present in Selenium webdriver.