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

Start coding something amazing with our library of open source Cloud code patterns. Content provided by IBM.

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

Code something amazing with the IBM library of open source blockchain patterns. Content provided by IBM.

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 }}