{
  "slug": "playwright-framelocator-searches-across-frames-without-a-selector-72555e379b24",
  "title": "Playwright frameLocator() searches across frames without a selector",
  "tools": [
    "playwright"
  ],
  "tags": [
    "agent"
  ],
  "introduced_at": "2026-09-04T22:40:31.000Z",
  "announced_at": "2026-09-04T22:40:31.000Z",
  "effective_at": null,
  "date_basis": "source-publication",
  "status": "unknown",
  "how": {
    "incantation": "If the target may be in any frame in the page subtree, call `page.frameLocator()` without a selector, then chain the locator for the element and act on it. The locator resolves inside one frame; matches in multiple frames throw an error.",
    "examples": [
      "const locator = page.frameLocator().getByRole('button');\nawait locator.click();",
      "const locator = frame.frameLocator().getByRole('button');\nawait locator.click();"
    ],
    "gotchas": [
      "Version: v1.63.0",
      "selector: Selector for the frame element. If omitted, search any frame on the page; for `frame.frameLocator()`, search this frame or any iframe inside it.",
      "getByRole(role) (required): Role used to locate the element; this usage example passes `button`.",
      "Prerequisite: `page.frameLocator` and `frame.frameLocator` were added in v1.17; use Playwright v1.17 or later.",
      "The rest of the locator resolves inside a single frame; an error is thrown when it matches elements in several frames."
    ]
  },
  "why_it_matters": "Locate an element that may appear in a frame anywhere in a page's frame subtree.",
  "before": "Locate the iframe first, then use its frame locator to search within it.",
  "sources": [
    "https://github.com/microsoft/playwright/releases/tag/v1.63.0",
    "https://playwright.dev/docs/api/class-page#page-frame-locator",
    "https://playwright.dev/docs/api/class-frame#frame-frame-locator"
  ],
  "rank": 0.99042,
  "judge": {
    "publish": true,
    "judge_model": "codex-cli/gpt-6-luna+typesafe/jev-1.13.0",
    "prompt_version": "extract-v7+enrich-v1+judge-v2x3+jev-publish-v1"
  },
  "review_state": "approved",
  "provenance": {
    "run_id": "augsep-20261008",
    "verdict_id": "augsep-20261008:augsep-20261008-579bf8375159b0fd-1:gate",
    "evidence_hash": "8f458d0a9fe7d706ecdbbba7433f7d4b9f5359e0c90f3581627b8ce9e8b79bc6"
  },
  "review": {
    "draft_hash": "9ccc0cc7b8a6544c484e37b9c4c9c2f73bf00a5019b9606d20860597cae22ab5",
    "reviewer": "publication-gate",
    "reviewed_at": "2026-10-07T00:00:00.000Z",
    "decision": "augsep-20261008:gate",
    "reason": "3 of 3 judge runs approved with p_yes >= 0.9 (mean 0.99 >= 0.9; 2 needed) and Jev gave 0.71 (>= 0.6 needed)."
  }
}
