Skip to content

[Bug]: Playwright CLI Drag is not working #40145

@sachinvarma-sf

Description

@sachinvarma-sf

Version

1.60.0

Steps to reproduce

Expected behavior

Expected: Drag-and-drop is performed between the two elements.

Actual behavior

Zod validation error:

[
  {
    "expected": "string",
    "code": "invalid_type",
    "path": ["startElement"],
    "message": "Invalid input: expected string, received undefined"
  },
  {
    "expected": "string",
    "code": "invalid_type",
    "path": ["endElement"],
    "message": "Invalid input: expected string, received undefined"
  }
]

Additional context

Root Cause:

The CLI daemon's drag command (playwright-core/lib/tools/cli-daemon/commands.js) converts positional args into startRef/endRef but never passes startElement/endElement to the MCP tool

Environment

System Software Overview:

      System Version: macOS 26.4 (25E246)
      Kernel Version: Darwin 25.4.0
      Boot Volume: Macintosh HD
      Boot Mode: Normal


Hardware:

      Model Name: MacBook Pro

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