Skip to content

--profile flag behavior is confusing: expects User Data Directory, not specific Chrome profile #256

@victorx-deckard

Description

@victorx-deckard

Description

The --profile flag has confusing behavior when trying to use specific Chrome profiles (like Profile 2). The help text says "store profile in specified directory," which suggests you can point it at a specific profile folder, but it actually expects a Chrome User Data Directory (the parent folder containing all profiles) and always uses the Default profile within it.

Steps to Reproduce

  1. Run the following command pointing to a specific Chrome profile:

    playwright-cli -s test open https://example.com --profile=/home/user/.config/google-chrome/Default --headed
  2. Observe that Playwright creates a nested Default/Default directory instead of using the existing Default profile.

  3. The correct usage is:

    playwright-cli -s test open https://example.com --profile=/home/user/.config/google-chrome --headed

    This uses /home/user/.config/google-chrome/Default (automatically appending Default).

Expected Behavior

Either:

  1. Option A (Fix documentation): Update the help text to clarify:

    --profile                   use persistent browser profile, specify User Data Directory (parent folder containing profiles, uses Default profile)
    
  2. Option B (Fix behavior): Allow users to specify a specific profile directory directly:

    playwright-cli --profile=/home/user/.config/google-chrome/Profile\ 2 open https://example.com

Actual Behavior

  • When you pass --profile=/path/to/google-chrome/Default, Playwright treats Default as a User Data Directory and creates Default/Default
  • When you pass --profile=/path/to/google-chrome, it correctly uses google-chrome/Default
  • There's no way to use non-Default profiles like Profile 2, Profile 3, etc.

Environment

  • OS: Ubuntu 24.04
  • playwright-cli version: 0.1.0
  • Browser: Chrome, Version 143.0.7499.169 (Official Build) (64-bit)

Metadata

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