Skip to content

Refactor: rename parameter 'ref' to 'target' in screenshots.mdx - #2129

Open
Eduardo Severo (eduardonsm) wants to merge 1 commit into
microsoft:mainfrom
eduardonsm:patch-1
Open

Refactor: rename parameter 'ref' to 'target' in screenshots.mdx#2129
Eduardo Severo (eduardonsm) wants to merge 1 commit into
microsoft:mainfrom
eduardonsm:patch-1

Conversation

@eduardonsm

Copy link
Copy Markdown

The documentation for browser_take_screenshot incorrectly lists ref as the parameter to capture a screenshot of a specific element. However, the actual JSON schema and implementation of @playwright/mcp expect the parameter name target.

When passing { ref: "e12" } as shown in the documentation, @playwright/mcp does not recognize ref, causing it to ignore the argument and default to capturing the full viewport instead of cropping to the specified element.

@EDWARD-012

Copy link
Copy Markdown

Heads-up: opened a broader docs PR that also fixes screenshots.mdx plus interaction/forms/etc.: https://github.com/microsoft/playwright.dev/pulls?q=is%3Apr+author%3AEDWARD-012

Tracking: microsoft/playwright#42539 (related to microsoft/playwright#42517). Happy for maintainers to take either your screenshots-only change or the combined PR — no hard feelings either way.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants