{"record":{"id":"8f7b7e40c67e7c53","repo":"microsoft/playwright","slug":"element-is-not-result-missingstate","errorCode":null,"errorMessage":"Element is not ${result.missingState}","messagePattern":"Element is not (.+?)","errorType":"exception","errorClass":"NonRecoverableDOMError","httpStatus":null,"severity":"error","filePath":"packages/playwright-core/src/server/dom.ts","lineNumber":372,"sourceCode":"          throw new NonRecoverableDOMError('Did not find some options');\n        progress.log('  did not find some options');\n        continue;\n      }\n      if (result === 'error:optionnotenabled') {\n        if (noAutoWaiting)\n          throw new NonRecoverableDOMError('Option being selected is not enabled');\n        progress.log('  option being selected is not enabled');\n        continue;\n      }\n      if (typeof result === 'object' && 'hitTargetDescription' in result) {\n        if (noAutoWaiting)\n          throw new NonRecoverableDOMError(`${result.hitTargetDescription} intercepts pointer events`);\n        progress.log(`  ${result.hitTargetDescription} intercepts pointer events`);\n        continue;\n      }\n      if (typeof result === 'object' && 'missingState' in result) {\n        if (noAutoWaiting)\n          throw new NonRecoverableDOMError(`Element is not ${result.missingState}`);\n        progress.log(`  element is not ${result.missingState}`);\n        continue;\n      }\n      return result;\n    }\n  }\n\n  async _retryPointerAction(progress: Progress, actionName: ActionName, waitForEnabled: boolean, action: (progress: Progress, point: types.Point) => Promise<void>,\n    options: { waitAfter: boolean | 'disabled' } & types.PointerActionOptions & types.PointerActionWaitOptions): Promise<'error:notconnected' | 'done'> {\n    // Note: do not perform locator handlers checkpoint to avoid moving the mouse in the middle of a drag operation.\n    const skipActionPreChecks = actionName === 'move and up';\n    return await this._retryAction(progress, actionName, async (progress, retry) => {\n      // By default, we scroll with protocol method to reveal the action point.\n      // However, that might not work to scroll from under position:sticky elements\n      // that overlay the target element. To fight this, we cycle through different\n      // scroll alignments. This works in most scenarios.\n      const scrollOptions: (ScrollIntoViewOptions | undefined)[] = [\n        undefined,","sourceCodeStart":354,"sourceCodeEnd":390,"githubUrl":"https://github.com/microsoft/playwright/blob/c8fc3bf8d31542d59b4d4d9eaab1df93ff541dc6/packages/playwright-core/src/server/dom.ts#L354-L390","documentation":"The action returned an object with `missingState`, a state precondition that did not hold (e.g. the element should be enabled/stable/editable but was not). With force:true or noAutoWaiting the loop cannot wait for the state, so it throws NonRecoverableDOMError(`Element is not <missingState>`).","triggerScenarios":"Performing a forced action when a state precondition — enabled, editable, stable — is false; e.g. clicking a button that is disabled with force:true, or typing into a readonly input with force.","commonSituations":"Disabled submit buttons tested with force before validation enables them; readonly fields; elements still animating (unstable) when force was used.","solutions":["Remove force:true so Playwright waits for the required state.","Satisfy the precondition that brings the element into the needed state (fill required fields to enable the button).","Inspect the missingState value in the message to know which state failed and address it."],"exampleFix":"// before\nawait page.locator('#submit').click({ force: true }); // disabled → throws 'not enabled'\n// after\nawait page.locator('#email').fill('a@b.com'); // enables submit\nawait page.locator('#submit').click();","handlingStrategy":"retry","validationCode":"// Meet the missing state, then act without force.\nawait page.locator('#email').fill('a@b.com'); // enables the button\nawait page.locator('#submit').click();","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Do not force actions that need a state precondition; let auto-wait handle it.","Inspect the missingState token in the message to know which state failed.","Satisfy preconditions (fill fields, wait for editable/enabled) first."],"tags":["dom","actionability","state","force"],"backgroundTag":null,"analyzedSha":"c8fc3bf8d31542d59b4d4d9eaab1df93ff541dc6","analyzedAt":"2026-08-12T07:26:36.950Z","schemaVersion":2},"datasetVersion":"2026-08-12T13:17:24.610Z"}