mcp-playwright icon indicating copy to clipboard operation
mcp-playwright copied to clipboard

Use getByLabel

Open danielvanmil opened this issue 6 months ago • 2 comments

Hello,

I tried the Playwright mpc server with Claude and it is very impressive. One thing I notices is the fact that very often the fill(...) method is used with a selector. It would be nice when the getByLabel(...) would be used to resolve elements as this works better and also is adviced by Playwright?

Is this possible?

Thanks

(see also https://github.com/microsoft/playwright-mcp/issues/499)

danielvanmil avatar May 30 '25 15:05 danielvanmil

update: it looks like https://github.com/microsoft/playwright-mcp uses getByLabel/getByRole as first strategy instead of fill(...) which seems to work immediately. So maybe the question is: how it is this repo/implementation related to https://github.com/microsoft/playwright-mcp

Thanks

danielvanmil avatar May 31 '25 18:05 danielvanmil

@danielvanmil They are not related. If the Microsoft one works better for your purposes then use it. My testing experience has been the opposite: I've been using the Microsoft version and relying on getByRole, getByText, getByLabel often returns ambiguous elements.

nashda avatar Jun 11 '25 02:06 nashda