Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

Capture a Screenshot in Selenium WebDriver

DZone's Guide to

Capture a Screenshot in Selenium WebDriver

· Web Dev Zone ·
Free Resource

Learn how Crafter’s Git-based content management system is reinventing modern digital experiences. Download this white paper now. 

Example of capturing a screenshot from Selenium WebDriver in Python:

#!/usr/bin/env python
from selenium import webdriver

browser = webdriver.Firefox()
browser.get('http://www.ubuntu.com/')
browser.save_screenshot('screenie.png')
browser.quit()

selenium/webdriver bindings for Python: http://pypi.python.org/pypi/selenium

Crafter CMS is a modern Git-based platform for building innovative websites and content-rich digital experiences. Download this white paper now.

Topics:

Published at DZone with permission of

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}