Take a Screenshot if a Test Fails using JUnit

By |2018-12-18T10:21:42+00:00December 18th, 2018|Categories: Selenium WebDriver|Tags: , , , , |

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 [...]