grafana/k6 · error
parsing frame uncheck options
Error message
parsing frame uncheck options %q: %w
What it means
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.
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)
Example fix
// before
frame.uncheck('#tos', { position: [4, 4] });
// after
frame.uncheck('#tos', { position: { x: 4, y: 4 } }); Defensive patterns
Strategy: validation
Validate before calling
if (opts?.position != null &&
!(typeof opts.position === 'object' && typeof opts.position.x === 'number' && typeof opts.position.y === 'number')) {
throw new Error('position must be { x: number, y: number }');
} Type guard
function isUncheckOptions(o) {
if (o == null) return true;
if (typeof o !== 'object' || Array.isArray(o)) return false;
const p = o.position;
return p == null || (typeof p === 'object' && typeof p.x === 'number' && typeof p.y === 'number');
} Try / catch
try { frame.uncheck(sel, opts); } catch (e) { if (!String(e.message).includes('parsing frame uncheck options')) throw e; } Prevention
- 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
When it happens
Trigger: 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.
Common situations: 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.
Related errors
- frame waitForFunction
- parsing check options
- parsing double click options
- parsing frame set check options
- parsing frame tap options
AI-assisted analysis of grafana/k6@8d06114777 (2026-09-14).
Data as JSON: /api/errors/2434b79261a5e293.
Report an issue: GitHub.
Appendix: source
Thrown at internal/js/modules/k6/browser/browser/frame_mapping.go:423
"title": func() *sobek.Promise {
return promise(vu, func() (any, error) {
return f.Title()
})
},
"type": func(selector, text string, opts sobek.Value) (*sobek.Promise, error) {
popts, err := parseFrameTypeOptions(rt, opts, f.Timeout())
if err != nil {
return nil, fmt.Errorf("parsing type options: %w", err)
}
return promise(vu, func() (any, error) {
return nil, f.Type(selector, text, popts) //nolint:wrapcheck
}), nil
},
"uncheck": func(selector string, opts sobek.Value) (*sobek.Promise, error) {
popts, err := parseFrameUncheckOptions(rt, opts, f.Timeout())
if err != nil {
return nil, fmt.Errorf("parsing frame uncheck options %q: %w", selector, err)
}
return promise(vu, func() (any, error) {
return nil, f.Uncheck(selector, popts) //nolint:wrapcheck
}), nil
},
"url": f.URL,
"waitForFunction": func(pageFunc, opts sobek.Value, args ...sobek.Value) (*sobek.Promise, error) {
js, popts, pargs, err := parseWaitForFunctionArgs(
rt, f.Timeout(), pageFunc, opts, args...,
)
if err != nil {
return nil, fmt.Errorf("frame waitForFunction: %w", err)
}
return promise(vu, func() (result any, reason error) {
return f.WaitForFunction(js, popts, pargs...) //nolint:wrapcheck
}), nilView on GitHub (pinned to 8d06114777)