Skip to content

[Bug]: launch_persistent_context hangs when started with record_video_dir outside of test #31769

Closed

Description

Version

1.45.0

Steps to reproduce

  1. run the following script
from playwright.sync_api import sync_playwright
import time

sync_playwright_started = sync_playwright().start()
binary_path = '/Applications/Google Chrome.app/Contents/MacOS/Google Chrome'
context = sync_playwright_started.chromium.launch_persistent_context(headless=True,
                                                                     executable_path=binary_path,
                                                                     record_video_dir='video',
                                                                     user_data_dir=SPECIFY_YOUR_DATA_DIR
                                                                     )

  1. Notice it hangs forever
  2. Run the same script above, having remove the record_video_dir option
  3. Notice it does not hang

Expected behavior

I expect to be able to record a video outside a test.

Actual behavior

The program execution hangs

Additional context

This issue makes me think that playwright intentionally does not support recording video outside a test context?

If so, I respect the design choice, but would be grateful for pointers as to how to make it work for me, outside the test context (I am happy with a messy solution).

Environment

MacOS
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    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