public
void test() throws IOException {
// Code to capture the screenshot File scrFile =
((TakesScreenshot)driver).getScreenshotAs(OutputType.FILE); //
Code to copy the screenshot in the desired locationFileUtils.copyFile(scrFile, new
File("C:\\CaptureScreenshot\\google.jpg"));
}