Take a Screenshot if a Test Fails using JUnit
How to check if a Test has failed using JUnit? This blog introduces the JUnit TestWatcher Class. We can use this to detect the Status of a Test Case, and if it has failed, we can then invoke a Method to do something - in this case, report the error and take a screenshot. There are [...]