{"id":"439c32a2cd083ff5","repo":"vitest-dev/vitest","slug":"method-getbytitle-is-not-supported-by-the-pro","errorCode":null,"errorMessage":"Method \"getByTitle\" is not supported by the \"${provider}\" provider.","messagePattern":"Method \"getByTitle\" is not supported by the \"(.+?)\" provider\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/browser/src/client/tester/context.ts","lineNumber":458,"sourceCode":"    throw new Error(`Method \"getByRole\" is not supported by the \"${provider}\" provider.`)\n  },\n  getByLabelText() {\n    throw new Error(`Method \"getByLabelText\" is not supported by the \"${provider}\" provider.`)\n  },\n  getByTestId() {\n    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)","sourceCodeStart":440,"sourceCodeEnd":476,"githubUrl":"https://github.com/vitest-dev/vitest/blob/d568f8ce3739b532d5bf2c1ee1e45e8a8a473d09/packages/browser/src/client/tester/context.ts#L440-L476","documentation":"page.getByTitle is a throwing stub (packages/browser/src/client/tester/context.ts:457-458). Title queries are only on Locator instances (getElementLocatorSelectors wires locator.getByTitle at context.ts:520). The page-level call throws.","triggerScenarios":"Calling page.getByTitle('Save document') directly on the page object.","commonSituations":"Tooltip/aria-title tests; expecting Playwright-style page.getByTitle.","solutions":["Use a Locator: page.elementLocator(document.body).getByTitle('Save document').","Register page.getByTitle via browser.locators.extend(...) if a top-level shortcut is needed."],"exampleFix":"// before\nconst el = page.getByTitle('Save')\n// after\nconst el = page.elementLocator(document.body).getByTitle('Save')","handlingStrategy":"type-guard","validationCode":"const root = page.elementLocator(document.body)\nconst el = root.getByTitle('Save document')","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Resolve title queries through a Locator instead of the page-level stub."],"tags":["browser","locators","getbytitle","page","unsupported"],"analyzedSha":"d568f8ce3739b532d5bf2c1ee1e45e8a8a473d09","analyzedAt":"2026-08-03T20:23:56.861Z","schemaVersion":2}