{"record":{"id":"2434b79261a5e293","repo":"grafana/k6","slug":"parsing-frame-uncheck-options-q-w","errorCode":null,"errorMessage":"parsing frame uncheck options %q: %w","messagePattern":"parsing frame uncheck options %q: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/js/modules/k6/browser/browser/frame_mapping.go","lineNumber":423,"sourceCode":"\t\t\"title\": func() *sobek.Promise {\n\t\t\treturn promise(vu, func() (any, error) {\n\t\t\t\treturn f.Title()\n\t\t\t})\n\t\t},\n\t\t\"type\": func(selector, text string, opts sobek.Value) (*sobek.Promise, error) {\n\t\t\tpopts, err := parseFrameTypeOptions(rt, opts, f.Timeout())\n\t\t\tif err != nil {\n\t\t\t\treturn nil, fmt.Errorf(\"parsing type options: %w\", err)\n\t\t\t}\n\n\t\t\treturn promise(vu, func() (any, error) {\n\t\t\t\treturn nil, f.Type(selector, text, popts) //nolint:wrapcheck\n\t\t\t}), nil\n\t\t},\n\t\t\"uncheck\": func(selector string, opts sobek.Value) (*sobek.Promise, error) {\n\t\t\tpopts, err := parseFrameUncheckOptions(rt, opts, f.Timeout())\n\t\t\tif err != nil {\n\t\t\t\treturn nil, fmt.Errorf(\"parsing frame uncheck options %q: %w\", selector, err)\n\t\t\t}\n\n\t\t\treturn promise(vu, func() (any, error) {\n\t\t\t\treturn nil, f.Uncheck(selector, popts) //nolint:wrapcheck\n\t\t\t}), nil\n\t\t},\n\t\t\"url\": f.URL,\n\t\t\"waitForFunction\": func(pageFunc, opts sobek.Value, args ...sobek.Value) (*sobek.Promise, error) {\n\t\t\tjs, popts, pargs, err := parseWaitForFunctionArgs(\n\t\t\t\trt, f.Timeout(), pageFunc, opts, args...,\n\t\t\t)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, fmt.Errorf(\"frame waitForFunction: %w\", err)\n\t\t\t}\n\n\t\t\treturn promise(vu, func() (result any, reason error) {\n\t\t\t\treturn f.WaitForFunction(js, popts, pargs...) //nolint:wrapcheck\n\t\t\t}), nil","sourceCodeStart":405,"sourceCodeEnd":441,"githubUrl":"https://github.com/grafana/k6/blob/8d06114777191d21ef885d05c5f8aa9e1ed838ae/internal/js/modules/k6/browser/browser/frame_mapping.go#L405-L441","documentation":"Thrown while parsing the options object of frame.uncheck(selector, options) (browser/frame_mapping.go:425); the selector is echoed in the message via %q. FrameUncheckOptions.Parse delegates to ElementHandleBasePointerOptions.Parse, whose only failing branch is position: it must export to a map of numeric x/y. strict, force, noWaitAfter, trial and timeout are coerced and cannot fail.","triggerScenarios":"frame.uncheck('#agree', { position: [10, 10] }); frame.uncheck('#agree', { position: 'bottomRight' }); position values loaded from config as strings, e.g. { position: { x: '10', y: '20' } } on strict export paths.","commonSituations":"Playwright scripts that pass point coordinates as an array; checklist automation where the checkbox sits in a scrollable container and a click position is supplied; coordinates coming from a preceding boundingBox() call serialized through JSON.","solutions":["Use an object with numeric fields: position: { x: 10, y: 20 }","Remove position to click the element center","Coerce coordinates with Number() when they come from JSON/env","Verify the selector string itself matches the intended element (it is included in the error for this purpose)"],"exampleFix":"// before\nframe.uncheck('#tos', { position: [4, 4] });\n// after\nframe.uncheck('#tos', { position: { x: 4, y: 4 } });","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 isUncheckOptions(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 { frame.uncheck(sel, opts); } catch (e) { if (!String(e.message).includes('parsing frame uncheck options')) throw e; }","preventionTips":["Never pass coordinates as [x, y]; always { x, y }","When a checkbox label overlaps the input, use a small numeric offset rather than a named position","Log the selector when wrapping uncheck calls — the error already carries it for diagnosis"],"tags":["k6","k6-browser","frame","uncheck","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"}