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
-
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
-
Observe that Playwright creates a nested Default/Default directory instead of using the existing Default profile.
-
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:
-
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)
-
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)
Description
The
--profileflag has confusing behavior when trying to use specific Chrome profiles (likeProfile 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 theDefaultprofile within it.Steps to Reproduce
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 --headedObserve that Playwright creates a nested
Default/Defaultdirectory instead of using the existingDefaultprofile.The correct usage is:
playwright-cli -s test open https://example.com --profile=/home/user/.config/google-chrome --headedThis uses
/home/user/.config/google-chrome/Default(automatically appendingDefault).Expected Behavior
Either:
Option A (Fix documentation): Update the help text to clarify:
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.comActual Behavior
--profile=/path/to/google-chrome/Default, Playwright treatsDefaultas a User Data Directory and createsDefault/Default--profile=/path/to/google-chrome, it correctly usesgoogle-chrome/DefaultProfile 2,Profile 3, etc.Environment