{"record":{"id":"d34eafcc05837216","repo":"grafana/k6","slug":"parsing-frame-set-check-options-w","errorCode":null,"errorMessage":"parsing frame set check options: %w","messagePattern":"parsing frame set check options: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/js/modules/k6/browser/browser/frame_mapping.go","lineNumber":348,"sourceCode":"\t\t\"selectOption\": func(selector string, values sobek.Value, opts sobek.Value) (*sobek.Promise, error) {\n\t\t\tpopts, err := parseFrameSelectOptionOptions(rt, opts, f.Timeout())\n\t\t\tif err != nil {\n\t\t\t\treturn nil, fmt.Errorf(\"parsing select option options: %w\", err)\n\t\t\t}\n\n\t\t\tconvValues, err := ConvertSelectOptionValues(rt, values)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, fmt.Errorf(\"parsing select options values: %w\", err)\n\t\t\t}\n\n\t\t\treturn promise(vu, func() (any, error) {\n\t\t\t\treturn f.SelectOption(selector, convValues, popts) //nolint:wrapcheck\n\t\t\t}), nil\n\t\t},\n\t\t\"setChecked\": func(selector string, checked bool, opts sobek.Value) (*sobek.Promise, error) {\n\t\t\tpopts, err := parseFrameCheckOptions(rt, opts, f.Timeout())\n\t\t\tif err != nil {\n\t\t\t\treturn nil, fmt.Errorf(\"parsing frame set check options: %w\", err)\n\t\t\t}\n\n\t\t\treturn promise(vu, func() (any, error) {\n\t\t\t\treturn nil, f.SetChecked(selector, checked, popts) //nolint:wrapcheck\n\t\t\t}), nil\n\t\t},\n\t\t\"setContent\": func(html string, opts sobek.Value) (*sobek.Promise, error) {\n\t\t\tpopts, err := parseFrameSetContentOptions(rt, opts, f.Page().NavigationTimeout())\n\t\t\tif err != nil {\n\t\t\t\treturn nil, fmt.Errorf(\"parsing setContent options: %w\", err)\n\t\t\t}\n\t\t\treturn promise(vu, func() (any, error) {\n\t\t\t\treturn nil, f.SetContent(html, popts) //nolint:wrapcheck\n\t\t\t}), nil\n\t\t},\n\t\t\"setInputFiles\": func(selector string, files sobek.Value, opts sobek.Value) (*sobek.Promise, error) {\n\t\t\tpopts, err := parseFrameSetInputFilesOptions(rt, opts, f.Timeout())\n\t\t\tif err != nil {","sourceCodeStart":330,"sourceCodeEnd":366,"githubUrl":"https://github.com/grafana/k6/blob/8d06114777191d21ef885d05c5f8aa9e1ed838ae/internal/js/modules/k6/browser/browser/frame_mapping.go#L330-L366","documentation":"Thrown when `frame.setChecked(selector, checked, opts)` options fail to parse into FrameCheckOptions, which embeds pointer options. Real failure point: `position` must export to a map of numbers ({ x, y }) — strings like 'center' or string coordinates fail rt.ExportTo and surface as \"parsing frame set check options: <cause>\". Other keys (force, noWaitAfter, timeout, trial, strict) are coercive.","triggerScenarios":"`frame.setChecked('#cb', true, { position: 'center' })` or `{ position: { x: '5', y: 5 } }` — the ExportTo(map[string]float64) conversion fails.","commonSituations":"Porting Playwright setChecked snippets with string pixel values; using position on tiny checkbox elements where pixel-exact coordinates were copied from devtools with units attached.","solutions":["Pass position as { x: <number>, y: <number> }","Omit position — the element center is used by default","Check the wrapped sobek conversion error for the exact key that failed"],"exampleFix":"// before\nawait frame.setChecked('#agree', true, { position: { x: '10', y: '10' } });\n\n// after\nawait frame.setChecked('#agree', true, { position: { x: 10, y: 10 } });","handlingStrategy":"validation","validationCode":"function assertSetCheckedOpts(opts = {}) {\n  if (opts.position !== undefined) {\n    const { x, y } = opts.position ?? {};\n    if (typeof x !== 'number' || typeof y !== 'number') throw new Error('position must be { x: number, y: number }');\n  }\n}","typeGuard":"function isPosition(p) {\n  return p == null || (typeof p === 'object' && typeof p.x === 'number' && typeof p.y === 'number');\n}","tryCatchPattern":"try {\n  await frame.setChecked(sel, true, opts);\n} catch (e) {\n  if (String(e).includes('parsing frame set check options')) { console.error('check position/modifiers shape'); throw e; }\n  throw e;\n}","preventionTips":["position must be numeric { x, y } — never 'center' or string coordinates","setChecked(selector, checked, opts) — the boolean is the second argument","Omit position to act on the element center"],"tags":["k6","browser","frame","set-checked","position","options"],"backgroundTag":"invalid-options-argument","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"}