selenium-webdriverTaking Screenshots


Introduction

Taking Screenshots and saving in a particular path

Syntax

  • File src = ((TakesScreenshot)driver).getScreenshotAs(OutputType.FILE);
  • FileUtils.copyFile(src, new File("D:\screenshot.png"));