Skip to content

[BUG] Error Message Provides Node.js API usage instead of Python #2059

@JavaScriptDude

Description

@JavaScriptDude

System info

  • Playwright Version: v1.35.0
  • Operating System: Ubuntu 22.04
  • Browser: Chromium
  • Other info: Python 3.7.9

Source code

  • I provided exact source code that allows reproducing the issue locally.

Link to the GitHub repository with the repro

Test file (self-contained)

from playwright.sync_api import sync_playwright
with sync_playwright() as p:
    launch_args = {"args": ['--user-data-dir=/tmp/foo123']}
    # This will give error with incorrect Node.js API usage instead of Python API
    browser = p.chromium.launch(**launch_args)

Steps

  • [Run the test]

Expected

Exception message should provide a hint to the Python API to use:
For example:
playwright._impl._api_types.Error: Pass user_data_dir parameter to <BrowserType>.launch_persistent_context(...) instead of specifying --user-data-dir argument

Actual

Error Message provides Node.js API usage:
playwright._impl._api_types.Error: Pass userDataDir parameter to browserType.launchPersistentContext(userDataDir, ...) instead of specifying --user-data-dir argument

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions