Everything is not easy at the beginning. Once you start your Selenium automation journey, you will frequently encounter certain exceptions in Selenium WebDriver. But don’t worry, we got you covered. It’s good to have a basic knowledge about 11 of the most common Exceptions in Selenium WebDriver which you may / may not encounter during the course of your test automation.
The basic rule of testing is to always take screenshot to base your claim. You can take screenshots at any stage of the test, but mostly, it is used for when a test fails and taking screenshots helps the analysis so we can see what went wrong during a test failure. The bugs you log should always have a screenshot attached to it. However, it is not necessary that screenshot should be taken only when you encounter a situation where expected result does not match the actual result. Screenshot are also taken as a proof that things are working fine. In this tutorial we will learn how to capture Screenshot in Selenium Webdriver using Java, i.e. TakesScreenshot class.