Screenshot

While there are multiple ways to take a screenshot in selenium, this is by far the most efficient of them all.

Syntax

driver.save_screenshot("image_name.image_extension")

Example

The below code with take a screenshot in a png format.

driver.save_screenshot("screenshot.png")
Updated on