locator.check
Resolve a semantic locator against the live page and report how many elements it matches, helping detect zero or multiple hits before test compilation and execution.
Instructions
Resolve a semantic locator against the live page and report how many elements it hits. A locator matching zero or several is far cheaper to find here than after compiling the test, running it three times and reading a strict-mode failure.
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": {
"target": "<target>"
},
"name": "locator.check"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| target | Yes | ||
| target_id | No | Target handle (tgt_*). Omit for the active page. | |
| browser_id | No | Browser handle (br_*). Omit to use the only running browser, or auto-launch one. | |
| test_id_attribute | No | Default "data-testid". |