{"record":{"id":"fa316d8c49cff2b7","repo":"microsoft/playwright","slug":"did-not-find-some-options","errorCode":null,"errorMessage":"Did not find some options","messagePattern":"Did not find some options","errorType":"exception","errorClass":"NonRecoverableDOMError","httpStatus":null,"severity":"error","filePath":"packages/playwright-core/src/server/dom.ts","lineNumber":354,"sourceCode":"      if (!options.skipActionPreChecks && !options.force && !noAutoWaiting)\n        await this._frame._page.performActionPreChecks(progress);\n      const result = await action(progress, retry);\n      ++retry;\n      if (result === 'error:notvisible') {\n        if (options.force || noAutoWaiting)\n          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}`);","sourceCodeStart":336,"sourceCodeEnd":372,"githubUrl":"https://github.com/microsoft/playwright/blob/c8fc3bf8d31542d59b4d4d9eaab1df93ff541dc6/packages/playwright-core/src/server/dom.ts#L336-L372","documentation":"selectOption returned 'error:optionsnotfound', meaning some of the requested option values/labels do not exist in the <select>. With force:true or noAutoWaiting the retry loop cannot wait for options to appear, so it throws NonRecoverableDOMError('Did not find some options').","triggerScenarios":"Calling locator.selectOption({ value }) / selectOption({ label }) with force:true where one or more of the specified values/labels are not present among the <option> elements.","commonSituations":"Dynamic select whose options load asynchronously and the test used force before they arrived; typo in the option value; multi-select where some requested values are invalid.","solutions":["Remove force:true so selectOption auto-waits until all requested options exist.","Verify the options before selecting: assert locator.locator('option[value=\"x\"]') is present.","Correct the requested value/label to match an existing <option>.","For async-loaded options, await the option's appearance first."],"exampleFix":"// before\nawait page.locator('select').selectOption({ value: 'fr' }, { force: true }); // 'fr' missing → throws\n// after\nawait page.locator('select').selectOption({ value: 'fr' }); // auto-waits for the option","handlingStrategy":"retry","validationCode":"// Wait for the option to exist, then select without force.\nawait page.locator(`option[value=\"${value}\"]`).waitFor();\nawait page.locator('select').selectOption({ value });","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Remove force:true on selectOption so it auto-waits for options.","For async-loaded options, await the specific <option> first.","Double-check requested values/labels against the actual option set."],"tags":["dom","select-option","actionability","force"],"backgroundTag":null,"analyzedSha":"c8fc3bf8d31542d59b4d4d9eaab1df93ff541dc6","analyzedAt":"2026-08-12T07:26:36.950Z","schemaVersion":2},"datasetVersion":"2026-08-12T13:17:24.610Z"}