Friday, 12 July 2013

How to capture the full page screenshot in webdriver


In order to get the full page screenshot using web driver,

//Include these packages in the script.
import java.io.File;
import org.apache.commons.io.FileUtils;

//Add these snippet to your code.
File scrFile = ((TakesScreenshot)driver).getScreenshotAs(OutputType.FILE);
FileUtils.copyFile(scrFile, new File("c:\\path\\filename.jpg"),true);

No comments:

Post a Comment

Angular JS Protractor Installation process - Tutorial Part 1

                     Protractor, formally known as E2E testing framework, is an open source functional automation framework designed spe...