adspace


How can we capture screenshots in selenium?

Answer Posted / Navneet Kumar

To capture a screenshot in Selenium, you can use the `TakesScreenshot` interface. Here's an example:
```
FileUtils.copyFile(driver.getScreenshotAs(OutputType.FILE), new File("screenshots/screenshot.png"));
```

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

what will be the first salary and what will be the hike in the salary?

935


What’s selenese?

923


Do you know how to locate a link using its text in selenium?

993


How can you fetch an attribute from an element? How to retrieve typed text from a textbox?

1202


Have you created any framework?

1045