{"record":{"id":"01b13413653cca65","repo":"microsoft/playwright","slug":"option-being-selected-is-not-enabled","errorCode":null,"errorMessage":"Option being selected is not enabled","messagePattern":"Option being selected is not enabled","errorType":"exception","errorClass":"NonRecoverableDOMError","httpStatus":null,"severity":"error","filePath":"packages/playwright-core/src/server/dom.ts","lineNumber":360,"sourceCode":"          throw new NonRecoverableDOMError('Element is not visible');\n        progress.log('  element is not visible');\n        continue;\n      }\n      if (result === 'error:notinviewport') {\n        if (options.force || noAutoWaiting)\n          throw new NonRecoverableDOMError('Element is outside of the viewport');\n        progress.log('  element is outside of the viewport');\n        continue;\n      }\n      if (result === 'error:optionsnotfound') {\n        if (noAutoWaiting)\n          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  }","sourceCodeStart":342,"sourceCodeEnd":378,"githubUrl":"https://github.com/microsoft/playwright/blob/c8fc3bf8d31542d59b4d4d9eaab1df93ff541dc6/packages/playwright-core/src/server/dom.ts#L342-L378","documentation":"selectOption returned 'error:optionnotenabled': the targeted <option> exists but is disabled. With force:true or noAutoWaiting the loop cannot wait for it to become enabled, so it throws NonRecoverableDOMError('Option being selected is not enabled').","triggerScenarios":"Calling selectOption with force:true on an option that carries the `disabled` attribute; selecting an option that is conditionally disabled until some precondition is met.","commonSituations":"Forms where certain options are disabled until prior fields are filled; the test skipped the precondition step and forced the select.","solutions":["Remove force:true so selectOption waits for the option to become enabled.","Satisfy the precondition (fill dependent fields) that enables the option before selecting.","If the option is permanently disabled, select a different, enabled option."],"exampleFix":"// before\nawait page.locator('select').selectOption({ value: 'premium' }, { force: true }); // disabled → throws\n// after\nawait page.locator('#accept-terms').check(); // enables the option\nawait page.locator('select').selectOption({ value: 'premium' });","handlingStrategy":"retry","validationCode":"// Satisfy the precondition that enables the option, then select without force.\nawait page.locator('#accept-terms').check();\nawait page.locator('select').selectOption({ value: 'premium' });","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Do not force-select disabled options; let auto-wait wait for them to enable.","Fill dependent fields that unlock the option before selecting.","If permanently disabled, choose a different enabled option."],"tags":["dom","select-option","disabled","force"],"backgroundTag":null,"analyzedSha":"c8fc3bf8d31542d59b4d4d9eaab1df93ff541dc6","analyzedAt":"2026-08-12T07:26:36.950Z","schemaVersion":2},"datasetVersion":"2026-08-12T13:17:24.610Z"}