executeautomation/mcp-playwright

Use getByLabel

Opened this issue · 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 microsoft/playwright-mcp#499)

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 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.