Answers

Question and Answer:

  Home  Automation

⟩ Explain me how can we capture screenshots in Selenium?

We can take the screenshots in selenium by using getScreenshotAs method of TakesScreenshot interface:

File scrFile = ((TakesScreenshot)driver).getScreenshotAs(OutputType.FILE);

FileUtils.copyFile(scrFile, new File("C:screenshot1.jpg"));

 146 views

More Questions for you: