Skip to content

[BUG] Execution hangs when trying to save video or delete video before calling page.close() #1462

@jfp1992

Description

@jfp1992

Context:

  • Playwright Version: 1.23
  • Operating System: Windows
  • Python: 3.9
  • Browser: All

Code Snippet



def run(playwright: Playwright) -> None:
    browser = playwright.chromium.launch(headless=False)
    context = browser.new_context(
            viewport={"width": 1920, "height": 1080},
            record_video_dir="temp_videos/",
            record_video_size={"width": 1920, "height": 1080})

    # Open new page
    page = context.new_page()

    # ---------------------
    # page.video.save_as("test.webm")
    # OR
    # page.video.delete()
    context.close()
    browser.close()


with sync_playwright() as playwright:
    run(playwright)

Describe the bug

Execution will hang, no stack trace will be produced when user tries to save video or delete video before closing the page (page.close)

Uncomment line 15 or 17 to reproduce

The docs for save_as suggest that it should be possible:
"Saves the video to a user-specified path. It is safe to call this method while the video is still in progress, or after the page has closed. "

Still in progress suggests that I do not need to page.close() first

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions