Taiko
Documentation

Home / API Reference

screenshot

Captures a screenshot of the page. Appends timeStamp to filename if no filepath given.

Examples

await screenshot()
await screenshot({path : 'screenshot.png'})
await screenshot({fullPage:true})
await screenshot(text('Images', toRightOf('gmail')))

Parameters


selector

options

options.fullpage boolean

toggles full page screenshot

Default value
false

options.path string

path of the output file

Default value
'Screenshot-${Date.now()}.png'

options.encoding string

encoding for the image

Default value
'base64'

Returns

Promise which resolves to buffer with captured screenshot if {encoding:'base64'} given, otherwise it resolves to undefined.

Promise<Buffer>