grafana/k6 · error

parsing isChecked options of selector

Error message

parsing isChecked options of selector %q: %w

What it means

Thrown when `frame.isChecked(selector, opts)` receives options that fail to parse into FrameIsCheckedOptions (FrameBaseOptions: `strict`, `timeout` ms). The selector is included in the message (%q) to identify the failing call. Parse is currently coercive, so this branch is defensive.

Solutions

  1. Use exactly { strict: boolean, timeout: number_ms }
  2. Check for typos in option keys — they are silently ignored rather than erroring
  3. Note the selector appears in the message, so the failing call is easy to locate in logs

Example fix

// before
await frame.isChecked('#cb', { timout: 3000 });

// after
await frame.isChecked('#cb', { timeout: 3000 });
Defensive patterns

Strategy: try-catch

Validate before calling

const opts = { timeout: 3000, strict: true };
if (typeof opts.strict !== 'boolean') throw new Error('strict must be a boolean');
if (opts.timeout != null && typeof opts.timeout !== 'number') throw new Error('timeout must be a number (ms)');

Type guard

function isFrameBaseOptions(o) {
  return o == null || (typeof o === 'object' &&
    (o.strict === undefined || typeof o.strict === 'boolean') &&
    (o.timeout === undefined || typeof o.timeout === 'number'));
}

Try / catch

try {
  await frame.isChecked(sel, opts);
} catch (e) {
  if (String(e).includes('parsing isChecked options')) { console.error(`bad opts for selector ${sel}`); } else { throw e; }
}

Prevention

When it happens

Trigger: Would only fire with a strict Parse; today `strict` and `timeout` are coerced and all other keys ignored, so no input produces this error.

Common situations: Passing Playwright-only option keys; typo'd keys (e.g. `timout`) being silently ignored, causing the default timeout to apply unexpectedly.

Related errors


AI-assisted analysis of grafana/k6@8d06114777 (2026-09-14). Data as JSON: /api/errors/84d853a7357e76a1. Report an issue: GitHub.

Appendix: source

Thrown at internal/js/modules/k6/browser/browser/frame_mapping.go:255

				return nil, fmt.Errorf("parsing inner text options: %w", err)
			}
			return promise(vu, func() (any, error) {
				return f.InnerText(selector, popts) //nolint:wrapcheck
			}), nil
		},
		"inputValue": func(selector string, opts sobek.Value) (*sobek.Promise, error) {
			popts, err := parseFrameInputValueOptions(rt, opts, f.Timeout())
			if err != nil {
				return nil, fmt.Errorf("parsing input value options: %w", err)
			}
			return promise(vu, func() (any, error) {
				return f.InputValue(selector, popts) //nolint:wrapcheck
			}), nil
		},
		"isChecked": func(selector string, opts sobek.Value) (*sobek.Promise, error) {
			popts, err := parseFrameIsCheckedOptions(rt, opts, f.Timeout())
			if err != nil {
				return nil, fmt.Errorf("parsing isChecked options of selector %q: %w", selector, err)
			}
			return promise(vu, func() (any, error) {
				return f.IsChecked(selector, popts) //nolint:wrapcheck
			}), nil
		},
		"isDetached": f.IsDetached,
		"isDisabled": func(selector string, opts sobek.Value) (*sobek.Promise, error) {
			popts, err := parseFrameIsDisabledOptions(rt, opts, f.Timeout())
			if err != nil {
				return nil, fmt.Errorf("parsing isDisabled options of selector %q: %w", selector, err)
			}
			return promise(vu, func() (any, error) {
				return f.IsDisabled(selector, popts) //nolint:wrapcheck
			}), nil
		},
		"isEditable": func(selector string, opts sobek.Value) (*sobek.Promise, error) {
			popts, err := parseFrameIsEditableOptions(rt, opts, f.Timeout())
			if err != nil {

View on GitHub (pinned to 8d06114777)