grafana/k6 · error

checking

Error message

checking %q: %w

What it means

Returned by Locator.Check when checking the element via Frame.check fails; strict mode and retry are enabled, so it typically fires when the selector matches zero or multiple elements, the element is not a checkable input, or it is not actionable in time. The input at fault is the locator's selector.

Solutions

  1. Use a selector that matches exactly one checkbox or radio element
  2. Increase the action timeout to let the element become actionable
  3. Verify the element is enabled and visible before checking it
Defensive patterns

Strategy: retry

When it happens

Trigger: Thrown at internal/js/modules/k6/browser/common/locator.go:182 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of grafana/k6@01ffac6f24 (2026-08-18). Data as JSON: /api/errors/1e4b8d1bb8350342. Report an issue: GitHub.

Appendix: source

Thrown at internal/js/modules/k6/browser/common/locator.go:182

	opts.Strict = true
	opts.retry = true
	if err := l.frame.setChecked(l.selector, checked, opts); err != nil {
		return fmt.Errorf("setting %q checked to %v: %w", l.selector, checked, err)
	}

	applySlowMo(l.ctx)

	return nil
}

// Check on an element using locator's selector with strict mode on.
func (l *Locator) Check(opts *FrameCheckOptions) error {
	l.log.Debugf("Locator:Check", "fid:%s furl:%q sel:%q opts:%+v", l.frame.ID(), l.frame.URL(), l.selector, opts)

	opts.Strict = true
	opts.retry = true
	if err := l.frame.check(l.selector, opts); err != nil {
		return fmt.Errorf("checking %q: %w", l.selector, err)
	}

	applySlowMo(l.ctx)

	return nil
}

// Uncheck on an element using locator's selector with strict mode on.
func (l *Locator) Uncheck(opts *FrameUncheckOptions) error {
	l.log.Debugf("Locator:Uncheck", "fid:%s furl:%q sel:%q opts:%+v", l.frame.ID(), l.frame.URL(), l.selector, opts)

	opts.Strict = true
	opts.retry = true
	if err := l.frame.uncheck(l.selector, opts); err != nil {
		return fmt.Errorf("unchecking %q: %w", l.selector, err)
	}

	applySlowMo(l.ctx)

View on GitHub (pinned to 01ffac6f24)