saveScreenshot
Overview
Use the saveScreenshot command to save a screenshot of the current browser context to a PNG file.
Keep in mind that some browser drivers capture screenshots of the entire document (e.g., the Gecko driver for Firefox), while others capture only the current viewport (e.g., Chromedriver for Chrome).
Usage
await browser.saveScreenshot(filepath);
Command Parameters
| Name | Type | Description |
| filepath | String | The path to the screenshot relative to the execution directory (the .png extension is mandatory). |