How to capture screen while running test suite
Create a file path file1 location where the image needs to be stored SimpleDateFormat sdf = new SimpleDateFormat("dd_MM_yyyy_HH_mm_ssaa") Date date=new Date(); public void screenshot() { try { System.out.println("Capturing screen........."); String filepath = file1+"\\image"+sdf.format(date)+new Date().getTime()+".png"; File srcfile = ((TakesScreenshot)driver).getScreenshotAs(OutputType.FILE); System.out.println("capturing.............."); FileUtils.copyFile(srcfile, new File(filepath)); Count++; String link1 = "<a href = "+filepath+">screenshot"+Count+"</a>"; org.testng.Reporter.log(link1); System.out.println("Image Captured"); } catch (IOException e) { e.printStackTrace(); } } In the above code the Just a System.out.println in the console location where the captured file is stored This is a selenium command, where t...