{"id":"ad3838006860c315","repo":"vitest-dev/vitest","slug":"method-framelocator-is-not-supported-by-the-p","errorCode":null,"errorMessage":"Method \"frameLocator\" is not supported by the \"${provider}\" provider.","messagePattern":"Method \"frameLocator\" is not supported by the \"(.+?)\" provider\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/browser/src/client/tester/context.ts","lineNumber":464,"sourceCode":"    throw new Error(`Method \"getByTestId\" is not supported by the \"${provider}\" provider.`)\n  },\n  getByAltText() {\n    throw new Error(`Method \"getByAltText\" is not supported by the \"${provider}\" provider.`)\n  },\n  getByPlaceholder() {\n    throw new Error(`Method \"getByPlaceholder\" is not supported by the \"${provider}\" provider.`)\n  },\n  getByText() {\n    throw new Error(`Method \"getByText\" is not supported by the \"${provider}\" provider.`)\n  },\n  getByTitle() {\n    throw new Error(`Method \"getByTitle\" is not supported by the \"${provider}\" provider.`)\n  },\n  elementLocator() {\n    throw new Error(`Method \"elementLocator\" is not supported by the \"${provider}\" provider.`)\n  },\n  frameLocator() {\n    throw new Error(`Method \"frameLocator\" is not supported by the \"${provider}\" provider.`)\n  },\n  extend(methods) {\n    for (const key in methods) {\n      (page as any)[key] = (methods as any)[key].bind(page)\n    }\n    return page\n  },\n}\n\nfunction convertToLocator(element: Element | Locator): Locator {\n  if (element instanceof Element) {\n    return page.elementLocator(element)\n  }\n  return element\n}\n\nfunction getTaskFullName(task: RunnerTask): string {\n  return task.suite ? `${getTaskFullName(task.suite)} ${task.name}` : task.name","sourceCodeStart":446,"sourceCodeEnd":482,"githubUrl":"https://github.com/vitest-dev/vitest/blob/d568f8ce3739b532d5bf2c1ee1e45e8a8a473d09/packages/browser/src/client/tester/context.ts#L446-L482","documentation":"page.frameLocator is a throwing stub (packages/browser/src/client/tester/context.ts:463-464). Vitest Browser runs each test file inside its own iframe managed by the orchestrator, so cross-iframe locator chaining via a page-level frameLocator is not implemented for the active provider. Calling it throws.","triggerScenarios":"Calling page.frameLocator('iframe#ads') to interact with a nested iframe's content from within a browser test.","commonSituations":"Porting Playwright page.frameLocator(...) usage into Vitest Browser; tests for widgets rendered in nested iframes (embeds, ads, third-party components).","solutions":["Query the iframe element directly and operate on its contentDocument/contentWindow instead of using a frameLocator.","Restructure the test to load the nested content in the main test iframe (avoid cross-frame interaction).","Use the orchestrator's multi-iframe APIs only if you control both frames; otherwise file a feature request — frameLocator is not supported in the current provider."],"exampleFix":"// before\nconst btn = page.frameLocator('iframe.widget').getByRole('button')\n// after\nconst iframe = document.querySelector('iframe.widget') as HTMLIFrameElement\nconst btn = iframe.contentDocument!.querySelector('button')!","handlingStrategy":"validation","validationCode":"// frameLocator is unsupported; reach into the iframe element directly.\nconst iframe = document.querySelector<HTMLIFrameElement>('iframe.widget')\nif (iframe?.contentDocument) {\n  const btn = iframe.contentDocument.querySelector('button')\n  // assert on btn\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Avoid page.frameLocator in Vitest Browser; reach into contentDocument/contentWindow instead.","Restructure tests so nested-iframe content is loaded in the main test iframe when possible."],"tags":["browser","locators","framelocator","iframe","unsupported"],"analyzedSha":"d568f8ce3739b532d5bf2c1ee1e45e8a8a473d09","analyzedAt":"2026-08-03T20:23:56.861Z","schemaVersion":2}