Skip to main content

Class: WebdriverScreenshotter

mugshot.WebdriverScreenshotter

Take screenshots from a Webdriver compatible client.

Implements#

Constructors#

constructor#

+ new WebdriverScreenshotter(client: Webdriver, __namedParameters?: WebdriverScreenshotterOptions): WebdriverScreenshotter

Parameters:#

NameTypeDefault valueDescription
clientWebdriver-
__namedParametersWebdriverScreenshotterOptions{}WebdriverScreenshotterOptions

Returns: WebdriverScreenshotter

Defined in: packages/mugshot/src/lib/webdriver-screenshotter.ts:46

Methods#

takeScreenshot#

takeScreenshot(selectorOrOptions?: MugshotSelector | ScreenshotOptions, options?: ScreenshotOptions): Promise<Buffer>

Take screenshots of selectors by first taking a viewport screenshot and then cropping the element out.

The element's bounding rectangle will be used to crop it out of the viewport screenshot.

Parameters:#

NameTypeDefault value
selectorOrOptions?MugshotSelector | ScreenshotOptions-
optionsScreenshotOptions{}

Returns: Promise<Buffer>

Implementation of: Screenshotter

Defined in: packages/mugshot/src/lib/webdriver-screenshotter.ts:70