Taking screenshots
During your Automated Testing, you can take screenshots of the current webpage by issuing a "Take Screenshot" command.
Depending on which framework/language binding you are using, the syntax might be a little bit different.
If you want to automatically take a screenshot for each step in your test, you can use the custom screenshot TestingBot capability.
Copy
driver.save_screenshot("screenshot.png")
Copy
File srcFile = ((TakesScreenshot) driver).getScreenshotAs(OutputType.FILE);
FileUtils.copyFile(srcFile, new File("/location/to/screenshot.png"));
Copy
file_put_contents('screenshot.png', $web_driver->takeScreenshot());
Copy
driver.save_screenshot('screenshot.png')
Copy
const fs = require('fs');
const data = await driver.takeScreenshot();
fs.writeFileSync('screenshot.png', data, 'base64');
Copy
Screenshot screenshot = ((ITakesScreenshot)driver).GetScreenshot();
screenshot.SaveAsFile("screenshot.png");