Check locator
check_locatorVerify how many elements a Playwright locator matches on a page and whether it is visible, so you can confirm it targets exactly one element before writing tests.
Instructions
Check how many elements a Playwright locator matches on a page (1 = good) and whether the match is visible. Accepts the same session as explore_page.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"url": "<url>",
"locator": "<locator>"
},
"name": "check_locator"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url | Yes | ||
| device | No | Emulate a device for mobile web: a Playwright device name such as "iPhone 15" or "Pixel 7" (list_devices), or "desktop" (default) | |
| devices | No | Check on several devices at once, e.g. ["desktop", "iPhone 15", "Pixel 7"] | |
| locator | Yes | e.g. page.getByRole('button', { name: 'Sign in' }) | |
| session | No | Reach pages behind a login or several steps into a flow |