AndroidAutomation FrameworkAutomation/QTP/Selenium BlogsOthersquestionsTechnical blogTravelTrending

How to take snapshot of browser using selenium

Code sample as below:

File srcFile = ((TakesScreenshot)driver).getScreenshotAs(OutputType.FILE);
FileUtils.copyFile(srcFile, new File(“snapshot.png”));