Skip to content

[Feature]: Automatically stop the screencast video recording and save the video file when the page is closed. #41608

Description

@yusuke-noda

🚀 Feature Request

Suppose recording is started using page.screencast.start({path: videoPath}). If the page closes before page.screencast.stop() is called to stop the recording, I would like the recording to stop automatically and the video file to be saved.

Example

await page.screencast.start({path: 'video.webm'});
await page.getByRole('button', {name: 'close window'}).click(); // close window
// video.webm file is automatically saved

Motivation

To control the recording area, I want to start recording using screencast.start() rather than the newContext() options.
However, this requires calling screencast.stop() before the page closes.
This makes it impossible to record a video showing "the window closing when a button is pressed."

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions