Hi Rajesh,
I am getting following two errors:
1. Resource Path Location Type
TakesScreenshot cannot be resolved to a
type FunctionLibrary.java /selenium_demo/src/com/example/selenium line
2. Description Resource Path Location Type
The method copyFile(File, File) is undefined for the type
FileUtils FunctionLibrary.java /selenium_demo/src/com/example/selenium line
my code is :
public boolean TakeScreenShot(String TestCaseName)
{
String path;
try {
WebDriver augmentedDriver = new Augmenter().augment(mydriver);
File source =
((TakesScreenshot)augmentedDriver).getScreenshotAs(OutputType.FILE);
path = "./target/screenshots/" + source.getName();
FileUtils.copyFile(source, new File(path));
}
catch(IOException e) {
path = "Failed to capture screenshot: " + e.getMessage();
}
return true;
}
Regards,
Anand