saveScreenshotSave a screenshot as a base64 encoded PNG with the current state of the browser. Be aware that some Selenium driver are taking screenshots of the whole document (e.g. phantomjs) and others only of the current viewport. If you want to always be sure that the screenshot has the size of the whole document, use WebdriverCSS to enhance this command with that functionality. Usage1client.saveScreenshot([filename]).then(callback); Parameters Param Type Details filenameoptional Function/String path to the generated image (relative to the execution directory) ExamplesaveScreenshot.js123456// receive screenshot as Bufferclient.saveScreenshot(function(err, screenshot, response) { ... });// save screenshot to file and receive as Bufferclient.saveScreenshot('./snapshot.png', function(err, screenshot, response) { ... });// save screenshot to fileclient.saveScreenshot('./snapshot.png'); Uses protocol/screenshot