Can anybody let me know how to take Full page screenshot in selenium webdriver in Firefox.
I am using TestNG Framework.
Below is the code I used @After Method-- But it's taking the screenshot of Viewport page only(page which we can see).
public void afterMethod(ITestResult result)
{
if(ITestResult.FAILURE==result.getStatus())
{
try
{
TakesScreenshot ts=(TakesScreenshot)driver;
File source=ts.getScreenshotAs(OutputType.FILE);
FileUtils.copyFile(source, new File("./Screenshots/"+result.getName()+".png"));
System.out.println("Screenshot taken");
}
catch (Exception e)
{
System.out.println("Exception while taking screenshot "+e.getMessage());
}
}