{"record":{"id":"0ee8728ac2f1e793","repo":"grafana/k6","slug":"parse-ischecked-options-of-selector-q-w","errorCode":null,"errorMessage":"parse isChecked options of selector %q: %w","messagePattern":"parse isChecked options of selector %q: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/js/modules/k6/browser/browser/page_mapping.go","lineNumber":291,"sourceCode":"\t\t\t\treturn nil, fmt.Errorf(\"parsing inner text options: %w\", err)\n\t\t\t}\n\t\t\treturn promise(vu, func() (any, error) {\n\t\t\t\treturn p.InnerText(selector, popts) //nolint:wrapcheck\n\t\t\t}), nil\n\t\t},\n\t\t\"inputValue\": func(selector string, opts sobek.Value) (*sobek.Promise, error) {\n\t\t\tpopts, err := parseFrameInputValueOptions(rt, opts, p.MainFrame().Timeout())\n\t\t\tif err != nil {\n\t\t\t\treturn nil, fmt.Errorf(\"parsing input value options: %w\", err)\n\t\t\t}\n\t\t\treturn promise(vu, func() (any, error) {\n\t\t\t\treturn p.InputValue(selector, popts) //nolint:wrapcheck\n\t\t\t}), nil\n\t\t},\n\t\t\"isChecked\": func(selector string, opts sobek.Value) (*sobek.Promise, error) {\n\t\t\tpopts, err := parseFrameIsCheckedOptions(rt, opts, p.MainFrame().Timeout())\n\t\t\tif err != nil {\n\t\t\t\treturn nil, fmt.Errorf(\"parse isChecked options of selector %q: %w\", selector, err)\n\t\t\t}\n\t\t\treturn promise(vu, func() (any, error) {\n\t\t\t\treturn p.IsChecked(selector, popts) //nolint:wrapcheck\n\t\t\t}), nil\n\t\t},\n\t\t\"isClosed\": p.IsClosed,\n\t\t\"isDisabled\": func(selector string, opts sobek.Value) (*sobek.Promise, error) {\n\t\t\tpopts, err := parseFrameIsDisabledOptions(rt, opts, p.MainFrame().Timeout())\n\t\t\tif err != nil {\n\t\t\t\treturn nil, fmt.Errorf(\"parse isDisabled options of selector %q: %w\", selector, err)\n\t\t\t}\n\t\t\treturn promise(vu, func() (any, error) {\n\t\t\t\treturn p.IsDisabled(selector, popts) //nolint:wrapcheck\n\t\t\t}), nil\n\t\t},\n\t\t\"isEditable\": func(selector string, opts sobek.Value) (*sobek.Promise, error) {\n\t\t\tpopts, err := parseFrameIsEditableOptions(rt, opts, p.MainFrame().Timeout())\n\t\t\tif err != nil {","sourceCodeStart":273,"sourceCodeEnd":309,"githubUrl":"https://github.com/grafana/k6/blob/8d06114777191d21ef885d05c5f8aa9e1ed838ae/internal/js/modules/k6/browser/browser/page_mapping.go#L273-L309","documentation":"Thrown synchronously by page.isChecked(selector, opts) when the underlying parse fails. FrameIsCheckedOptions embeds FrameBaseOptions, whose Parse (internal/js/modules/k6/browser/common/frame_options.go:218-232) reads only strict/timeout, coerces both and always returns nil — so on stock k6 this message is defensive/unreachable. The wrapper is notable for including the selector in the message, unlike most siblings.","triggerScenarios":"Not reachable with current stock code; a custom parser validating strict/timeout types could raise it, naming the offending selector.","commonSituations":"Custom xk6 builds with stricter validation; version drift.","solutions":["Keep opts to { strict: boolean, timeout: numberMs }","Omit opts for default behavior","Use the selector echoed in the message to locate the offending call site in loops"],"exampleFix":"// before\nawait page.isChecked('#opt-in', { timeout: '1s' });\n\n// after\nawait page.isChecked('#opt-in', { timeout: 1000 });","handlingStrategy":"validation","validationCode":"const ALLOWED = new Set(['timeout', 'strict']);\nconst bad = Object.keys(opts ?? {}).filter(k => !ALLOWED.has(k));\nif (bad.length) console.warn(`isChecked ignores unknown options: ${bad.join(', ')}`);\nif (opts?.timeout !== undefined && !Number.isInteger(opts.timeout)) {\n  throw new Error('isChecked timeout must be integer milliseconds');\n}\nawait page.isChecked(selector, opts);","typeGuard":"/** @param {unknown} o */\nfunction isBaseOpts(o) {\n  if (o === undefined || o === null) return true;\n  if (typeof o !== 'object') return false;\n  const t = /** @type {any} */ (o);\n  return (t.timeout === undefined || Number.isInteger(t.timeout))\n    && (t.strict === undefined || typeof t.strict === 'boolean');\n}","tryCatchPattern":"try {\n  return await page.isChecked(selector, opts);\n} catch (e) {\n  if (String(e).includes('isChecked options')) {\n    return await page.isChecked(selector);\n  } throw e;\n}","preventionTips":["isChecked accepts only timeout and strict","The message includes the selector — use it to find the bad call in loops","Keep boolean-check option objects minimal or omit them"],"tags":["k6","browser","page","is-checked","options"],"backgroundTag":"invalid-option-type","analyzedSha":"8d06114777191d21ef885d05c5f8aa9e1ed838ae","analyzedAt":"2026-09-14T20:10:14.619Z","contentChangedAt":"2026-09-14T20:10:14.619Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}