This step captures a PNG screenshot of the current page at the browser's active viewport size and writes it to the configured screenshot directory. A matching .html file containing the page source is saved alongside the PNG so you can inspect DOM state at the moment the screenshot was taken. The filename follows the pattern configured via WEBSHIP_SCREENSHOT_PATTERN (default: {datetime}.{feature_file}.feature_{step_line}.{ext}).
The step does not assert anything - it is a pure side-effect step used for visual inspection, debugging, or archiving page state during a scenario. If WEBSHIP_SCREENSHOT_FULLSCREEN is set to true in the environment or in worldParameters.screenshot.alwaysFullscreen, the capture will expand to the full scrollable height even when this viewport-only step is used. Note that screenshots are also captured automatically on every failed step (controlled by WEBSHIP_SCREENSHOT_ON_FAILED, enabled by default) and optionally after every step for scenarios tagged @screenshots.
Accepted phrasings
Then I save screenshot
Then we save screenshot
Then save screenshot
When I save screenshot
When we save screenshot
When save screenshot
Examples
Then I save screenshot
When I save screenshot
Then save screenshot
Given I am on "/about-us"
Then I save screenshot
In a real scenario
Scenario: Capture the search results page after a keyword query
Given I am on "/search"
When I fill in "q" with "annual report"
And I press "Search"
Then I should see "Results for"
And I save screenshot