⟩ Explain me how can we capture screenshots in Selenium?
We can take the screenshots in selenium by using getScreenshotAs method of TakesScreenshot interface:
File scrFile = ((TakesScreenshot)driver).getScreenshotAs(OutputType.FILE);
FileUtils.copyFile(scrFile, new File("C:screenshot1.jpg"));