---
title: Taking Screenshots with Selenium WebDriver
description: How to take screenshots during testing with Selenium WebDriver
source_url:
  html: https://testingbot.com/support/web-automate/selenium/screenshots
  md: https://testingbot.com/support/web-automate/selenium/screenshots/index.md
---
# 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](https://testingbot.com/support/web-automate/selenium/test-options#screenshot).

[Ruby](https://testingbot.com#)[Python](https://testingbot.com#)[PHP](https://testingbot.com#)[Java](https://testingbot.com#)[NodeJS](https://testingbot.com#)[C#](https://testingbot.com#)

    driver.save_screenshot("screenshot.png")

    File srcFile = ((TakesScreenshot) driver).getScreenshotAs(OutputType.FILE);
    FileUtils.copyFile(srcFile, new File("/location/to/screenshot.png"));

    file_put_contents('screenshot.png', $web_driver->takeScreenshot());

    driver.save_screenshot('screenshot.png')

    const fs = require('fs');
    
    const data = await driver.takeScreenshot();
    fs.writeFileSync('screenshot.png', data, 'base64');

    Screenshot screenshot = ((ITakesScreenshot)driver).GetScreenshot();
    screenshot.SaveAsFile("screenshot.png");

Was this page helpful? Yes No 

## Looking for More Help?

Have questions or need more information?   
 You can reach us via the following channels:

- [Email us](https://testingbot.com/contact/new)
- [Join our Slack Channel](https://join.slack.com/t/testingb0t/shared_invite/zt-3bcw9xch-jk19~6XPs_xBrsAgAedkCw)
