Skip to content

IWebDriver.GetScreenshot()

Yngve Bakken Nilsen edited this page Jun 24, 2014 · 6 revisions

Support: Any browser that supports HTML5 Canvas and HTML5 localstorage

Returns: System.Byte[]


The GetScreenshot method that already exists does not work when Selenium is running in an Non-interactive session. This extension attempts to solve this.

This method will inject Javascript onto the page, and render the contents to a canvas-object which then is sent back to Domify and converted into an Base64 Byte-array that can be used to create an Image. Since the screenshots are based on a HTML5 rendition of the page, the accuracy of certain elements and colours might not be 100%, but the intention is to give some sort of feedback in cases where you're not able to see the run for yourself.

This is an experimental feature, and should be used with care.

Clone this wiki locally