# Take screenshot even if the test case get passed

**URL:** <https://www.ruby-forum.com/t/take-screenshot-even-if-the-test-case-get-passed/236486>\
**Category:** RSpec\
**Created:** [September 6, 2013, 12:37pm UTC](https://www.ruby-forum.com/t/take-screenshot-even-if-the-test-case-get-passed/236486 "2013-09-06T12:37:58Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![addis\_a](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/c4cdca/32.png) [@addis\_a](https://www.ruby-forum.com/u/addis_a)\
**Post date:** [September 6, 2013, 12:37pm UTC](https://www.ruby-forum.com/t/take-screenshot-even-if-the-test-case-get-passed/236486/1 "2013-09-06T12:37:58Z")

</div>

Hi,

I am using selenium webdriver and rspec so when a test case fail a  
screenshot is taken. But is there any way to take a screenshot for all  
test cases so even when the test case pass?

Thanks in advance!  
Mattias

---

<div class="post-metadata">

**Author:** ![maetthew](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/dbc845/32.png) [@maetthew](https://www.ruby-forum.com/u/maetthew)\
**Post date:** [September 6, 2013, 1:43pm UTC](https://www.ruby-forum.com/t/take-screenshot-even-if-the-test-case-get-passed/236486/2 "2013-09-06T13:43:51Z")

</div>

I found the solution! driver.save\_screenshot(./screenshot.png)

> **[GitHub - SeleniumHQ/selenium-google-code-issue-archive: Archive, please see...](https://github.com/seleniumhq/selenium-google-code-issue-archive)**
>
> Archive, please see main selenium repo. Contribute to SeleniumHQ/selenium-google-code-issue-archive development by creating an account on GitHub.
