---
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.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#)

```ruby
driver.save_screenshot("screenshot.png")
```

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

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

```python
driver.save_screenshot('screenshot.png')
```

```javascript
const fs = require('fs');

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

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

### Looking for more help?

Have questions or need more information? Reach out via email or Slack.

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