I am doing automation of a screenshot. I am using selenium with java.
Some errors are occurred in my program . Can you tell me about this error ?
selenium java program :
package eCommerceLive;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.testng.annotations.BeforeTest;
import org.apache.commons.io.FileUtils;
import java.io.File;
import java.io.IOException;
import org.openqa.selenium.WebDriver;
import java.util.concurrent.TimeUnit;
import org.junit.Test;
import org.openqa.selenium.OutputType;
import org.openqa.selenium.TakesScreenshot;
public class ScreenshotCapture
{
WebDriver driver;
@BeforeTest
public void setup()
{
System.setProperty("webdriver.firefox.marionette","pathToGeckoDRiver");
driver = new FirefoxDriver();
driver.get("http://doc.local/");
driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);
}
@Test
public void ScreenShot()
{
File file=(TakesScreenshot)driver).getScreenshotAs(OutputType.FILE);
FileUtils.copyFile(file, new File("/home/naveen"));
}
}