This is an excerpt from Manning's book JUnit in Action, Second Edition. Login to get full access to this book.
Listing 12.17. Capturing a screen shot on JUnit 4 test failure