{"record":{"id":"fbd656626cac4164","repo":"grafana/k6","slug":"parsing-check-options-w-fbd656","errorCode":null,"errorMessage":"parsing check options: %w","messagePattern":"parsing check options: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/js/modules/k6/browser/browser/locator_mapping.go","lineNumber":122,"sourceCode":"\t\t\t\tif err != nil {\n\t\t\t\t\treturn nil, err //nolint:wrapcheck\n\t\t\t\t}\n\t\t\t\treturn mapJSHandle(vu, jsh), nil\n\t\t\t}), nil\n\t\t},\n\t\t\"setChecked\": func(checked bool, opts sobek.Value) (*sobek.Promise, error) {\n\t\t\tcopts, err := parseFrameCheckOptions(rt, opts, lo.Timeout())\n\t\t\tif err != nil {\n\t\t\t\treturn nil, fmt.Errorf(\"parsing set checked options: %w\", err)\n\t\t\t}\n\t\t\treturn promise(vu, func() (any, error) {\n\t\t\t\treturn nil, lo.SetChecked(checked, copts) //nolint:wrapcheck\n\t\t\t}), nil\n\t\t},\n\t\t\"check\": func(opts sobek.Value) (*sobek.Promise, error) {\n\t\t\tcopts, err := parseFrameCheckOptions(rt, opts, lo.Timeout())\n\t\t\tif err != nil {\n\t\t\t\treturn nil, fmt.Errorf(\"parsing check options: %w\", err)\n\t\t\t}\n\t\t\treturn promise(vu, func() (any, error) {\n\t\t\t\treturn nil, lo.Check(copts) //nolint:wrapcheck\n\t\t\t}), nil\n\t\t},\n\t\t\"uncheck\": func(opts sobek.Value) (*sobek.Promise, error) {\n\t\t\tcopts, err := parseFrameUncheckOptions(rt, opts, lo.Timeout())\n\t\t\tif err != nil {\n\t\t\t\treturn nil, fmt.Errorf(\"parsing uncheck options: %w\", err)\n\t\t\t}\n\t\t\treturn promise(vu, func() (any, error) {\n\t\t\t\treturn nil, lo.Uncheck(copts) //nolint:wrapcheck\n\t\t\t}), nil\n\t\t},\n\t\t\"isChecked\": func(opts sobek.Value) (*sobek.Promise, error) {\n\t\t\tcopts, err := parseFrameIsCheckedOptions(rt, opts, lo.Timeout())\n\t\t\tif err != nil {\n\t\t\t\treturn nil, fmt.Errorf(\"parsing is checked options: %w\", err)","sourceCodeStart":104,"sourceCodeEnd":140,"githubUrl":"https://github.com/grafana/k6/blob/8d06114777191d21ef885d05c5f8aa9e1ed838ae/internal/js/modules/k6/browser/browser/locator_mapping.go#L104-L140","documentation":"Thrown while parsing the options object of locator.check(options) (browser/locator_mapping.go:121). Like setChecked it wraps FrameCheckOptions.Parse, and the only failing branch is position (must export to a numeric x/y map via ElementHandleBasePointerOptions.Parse). strict, force, noWaitAfter, trial and timeout are coerced.","triggerScenarios":"locator.check({ position: [5, 5] }); locator.check({ position: 'center' }); string x/y values from config objects.","commonSituations":"Terms-of-service/consent checkbox flows; ported Playwright scripts with array positions; shared option objects reused across check() and click() where shapes drifted.","solutions":["Use position: { x: 5, y: 5 } with numeric fields","Drop position to click the element center","Normalize config values with Number()","Keep check/uncheck option builders in one place so the shape stays correct"],"exampleFix":"// before\nlocator.check({ position: [5, 5] });\n// after\nlocator.check({ position: { x: 5, y: 5 } });","handlingStrategy":"validation","validationCode":"if (opts?.position != null &&\n    !(typeof opts.position === 'object' && typeof opts.position.x === 'number' && typeof opts.position.y === 'number')) {\n  throw new Error('position must be { x: number, y: number }');\n}","typeGuard":"function isCheckOptions(o) {\n  if (o == null) return true;\n  if (typeof o !== 'object' || Array.isArray(o)) return false;\n  const p = o.position;\n  return p == null || (typeof p === 'object' && typeof p.x === 'number' && typeof p.y === 'number');\n}","tryCatchPattern":"try { await locator.check(opts); } catch (e) { if (!String(e.message).includes('parsing check options')) throw e; }","preventionTips":["Use { x, y } numeric positions only","Build check/uncheck options from one validated helper","Convert any coordinates from external data with Number() before use"],"tags":["k6","k6-browser","locator","check","position","options"],"backgroundTag":"options-validation-failed","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"}