{"record":{"id":"ff22e75b42f60d81","repo":"garrytan/gstack","slug":"usage-browse-fill-selector-value","errorCode":null,"errorMessage":"Usage: browse fill <selector> <value>","messagePattern":"Usage: browse fill <selector> <value>","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"browse/src/write-commands.ts","lineNumber":378,"sourceCode":"          : await target.locator(resolved.selector).evaluate(\n              el => el.tagName === 'OPTION'\n            ).catch(() => false);\n        if (isOption) {\n          throw new Error(\n            `Cannot click <option> elements. Use 'browse select <parent-select> <value>' instead of 'click' for dropdown options.`\n          );\n        }\n        throw err;\n      }\n      // Wait for network to settle (catches XHR/fetch triggered by clicks)\n      await page.waitForLoadState('networkidle', { timeout: 2000 }).catch(() => {});\n      return `Clicked ${selector} → now at ${page.url()}`;\n    }\n\n    case 'fill': {\n      const [selector, ...valueParts] = args;\n      const value = valueParts.join(' ');\n      if (!selector || !value) throw new Error('Usage: browse fill <selector> <value>');\n      const resolved = await session.resolveRef(selector);\n      if ('locator' in resolved) {\n        await resolved.locator.fill(value, { timeout: 5000 });\n      } else {\n        await target.locator(resolved.selector).fill(value, { timeout: 5000 });\n      }\n      // Wait for network to settle (form validation XHRs)\n      await page.waitForLoadState('networkidle', { timeout: 2000 }).catch(() => {});\n      return `Filled ${selector}`;\n    }\n\n    case 'select': {\n      const [selector, ...valueParts] = args;\n      const value = valueParts.join(' ');\n      if (!selector || !value) throw new Error('Usage: browse select <selector> <value>');\n      const resolved = await session.resolveRef(selector);\n      if ('locator' in resolved) {\n        await resolved.locator.selectOption(value, { timeout: 5000 });","sourceCodeStart":360,"sourceCodeEnd":396,"githubUrl":"https://github.com/garrytan/gstack/blob/94993f74012782fd94416dd44b8314f6363a13a4/browse/src/write-commands.ts#L360-L396","documentation":"Error \"Usage: browse fill <selector> <value>\" thrown in garrytan/gstack.","triggerScenarios":"Thrown at browse/src/write-commands.ts:378 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":"94993f74012782fd94416dd44b8314f6363a13a4","analyzedAt":"2026-08-12T04:06:23.140Z","schemaVersion":2},"datasetVersion":"2026-08-12T13:17:24.610Z"}