{"record":{"id":"e71039b52c533c90","repo":"microsoft/playwright","slug":"inner-hasnot-locator-must-belong-to-the-same-fra","errorCode":null,"errorMessage":"Inner \"hasNot\" locator must belong to the same frame.","messagePattern":"Inner \"hasNot\" locator must belong to the same frame\\.","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/playwright-core/src/client/locator.ts","lineNumber":74,"sourceCode":"    this._selector = selector;\n\n    if (options?.hasText)\n      this._selector += ` >> internal:has-text=${escapeForTextSelector(options.hasText, false)}`;\n\n    if (options?.hasNotText)\n      this._selector += ` >> internal:has-not-text=${escapeForTextSelector(options.hasNotText, false)}`;\n\n    if (options?.has) {\n      const locator = options.has;\n      if (locator._frame !== frame)\n        throw new Error(`Inner \"has\" locator must belong to the same frame.`);\n      this._selector += ` >> internal:has=` + JSON.stringify(locator._selector);\n    }\n\n    if (options?.hasNot) {\n      const locator = options.hasNot;\n      if (locator._frame !== frame)\n        throw new Error(`Inner \"hasNot\" locator must belong to the same frame.`);\n      this._selector += ` >> internal:has-not=` + JSON.stringify(locator._selector);\n    }\n\n    if (options?.visible !== undefined)\n      this._selector += ` >> visible=${options.visible ? 'true' : 'false'}`;\n\n    if (inspect.custom)\n      (this as any)[inspect.custom] = () => this._inspect();\n  }\n\n  private async _withElement<R>(task: (handle: ElementHandle<SVGElement | HTMLElement>, timeout?: number) => Promise<R>, options: { title: string, internal?: boolean, timeout?: number, signal?: AbortSignal }): Promise<R> {\n    const timeout = this._frame._timeout({ timeout: options.timeout }).timeout;\n    const deadline = timeout ? monotonicTime() + timeout : 0;\n\n    return await this._frame._wrapApiCall<R>(async () => {\n      const result = await this._frame._channel.waitForSelector({ selector: this._selector, strict: true, state: 'attached' }, { signal: options.signal, timeout });\n      const handle = ElementHandle.fromNullable(result.element) as ElementHandle<SVGElement | HTMLElement> | null;\n      if (!handle)","sourceCodeStart":56,"sourceCodeEnd":92,"githubUrl":"https://github.com/microsoft/playwright/blob/c8fc3bf8d31542d59b4d4d9eaab1df93ff541dc6/packages/playwright-core/src/client/locator.ts#L56-L92","documentation":"Error \"Inner \"hasNot\" locator must belong to the same frame.\" thrown in microsoft/playwright.","triggerScenarios":"Thrown at packages/playwright-core/src/client/locator.ts:74 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"c8fc3bf8d31542d59b4d4d9eaab1df93ff541dc6","analyzedAt":"2026-08-12T07:26:36.950Z","schemaVersion":2},"datasetVersion":"2026-08-12T13:17:24.610Z"}