Skip to content

[Bug]: playwright-test MCP server with browser.newContext() fails #39241

@EikeSchwass

Description

@EikeSchwass

Version

1.58.2

Steps to reproduce

  1. Clone https://github.com/EikeSchwass/PlaywrightMCPNewBrowserContext
  2. Execute tool generate_setup_page of the Playwright-test MCP Server (npx playwright run-test-mcp-server)

Expected behavior

Tool result: Success:


Running 1 test using 1 worker
### Paused at end of test. ready for interaction

### Page state
- Page URL: about:blank
- Page Title:
- Page Snapshot:

Actual behavior

Tool result: Error:

Running 1 test using 1 worker
TypeError: Cannot read properties of undefined (reading 'initialize')
Error while running the seed test.

Additional context

The only info I had was the cryptic "TypeError: Cannot read properties of undefined (reading 'initialize')".
If creation of new browser contexts is not supported by the MCP server, that should be documented somewhere.
In that case, this would be a feature request^^

Environment

System:
    OS: Windows 11 10.0.26100
    CPU: (8) x64 11th Gen Intel(R) Core(TM) i7-1165G7 @ 2.80GHz
    Memory: 6.40 GB / 31.69 GB
  Binaries:
    Node: 18.20.8 - C:\Program Files\nodejs\node.EXE
    npm: 10.8.2 - C:\Program Files\nodejs\npm.CMD
  IDEs:
    VSCode: 1.109.2 - C:\Program Files\VS Code\bin\code.CMD
  Languages:
    Bash: 5.2.32 - C:\Windows\system32\bash.EXE
  npmPackages:
    @playwright/test: 1.58.2 => 1.58.2
    playwright: 1.58.2 => 1.58.2

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