Overview - Screenshot on failure
What is it?
Screenshot on failure is a technique in automated testing where the test system takes a picture of the application screen when a test fails. This helps testers see exactly what was on the screen at the moment of failure. It is commonly used in Selenium tests to capture browser state for debugging. The screenshot is saved as an image file for later review.
Why it matters
Without screenshots on failure, testers must rely only on error messages or logs, which may not show the full picture of what went wrong. Screenshots provide visual proof and help quickly identify UI problems or unexpected states. This saves time and reduces guesswork when fixing bugs. In fast-moving projects, it prevents delays caused by unclear failures.
Where it fits
Before learning this, you should know basic Selenium test writing and how to run tests. After this, you can learn advanced test reporting, integrating screenshots with test reports, and using continuous integration tools to capture failures automatically.