@Test
void captureScreenshot() throws IOException {
WebDriver driver = new ChromeDriver();
driver.get("https://www.selenium.dev/");
TakesScreenshot scrShot =((TakesScreenshot)driver);
File srcFile=scrShot.getScreenshotAs(OutputType.FILE);
File destFile=new File("target/selenium.png");
FileUtils.copyFile(srcFile, destFile);
}