Take screenshot even if the test case get passed


#1

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


#2

I found the solution! driver.save_screenshot(./screenshot.png)

https://code.google.com/p/selenium/source/browse/rb/lib/selenium/webdriver/common/driver_extensions/takes_screenshot.rb?spec=svnc760e25d147e8a58e2dda9d651811f50f19b0300&r=c760e25d147e8a58e2dda9d651811f50f19b0300