saveScreenshot
Save a screenshot of an element to a PNG file on your OS.
Usage​
await $(selector).saveScreenshot(filename)
Parameters​
| Name | Type | Details |
|---|---|---|
filename | String | path to the generated image (.png suffix is required) relative to the execution directory |
Example​
saveScreenshot.js
it('should save a screenshot of the browser view', async () => {
const elem = await $('#someElem');
await elem.saveScreenshot('./some/path/elemScreenshot.png');
});
Returns​
- <Buffer>
return: screenshot buffer