grafana/k6 · error

checking is enabled

Error message

checking is %q enabled: %w

What it means

Wrapped failure from Frame.isEnabled while checking whether the element matched by the locator's selector is enabled (strict mode forced). Fires on selector mismatch (none or multiple matches) or a failed CDP evaluation — a disabled element returns (false, nil) rather than this error.

Solutions

  1. Use a selector matching exactly one element
  2. Confirm the element is present before the check (locator.WaitFor)
  3. Handle the error distinctly from the false enabled state in test logic
Defensive patterns

Strategy: try-catch

When it happens

Trigger: Thrown at internal/js/modules/k6/browser/common/locator.go:241 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/269ae0cdeaa4c818. Report an issue: GitHub.

Appendix: source

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

	opts.Strict = true
	editable, err := l.frame.isEditable(l.selector, opts)
	if err != nil {
		return false, fmt.Errorf("checking is %q editable: %w", l.selector, err)
	}

	return editable, nil
}

// IsEnabled returns true if the element matches the locator's
// selector and is Enabled. Otherwise, returns false.
func (l *Locator) IsEnabled(opts *FrameIsEnabledOptions) (bool, error) {
	l.log.Debugf("Locator:IsEnabled", "fid:%s furl:%q sel:%q opts:%+v", l.frame.ID(), l.frame.URL(), l.selector, opts)

	opts.Strict = true
	enabled, err := l.frame.isEnabled(l.selector, opts)
	if err != nil {
		return false, fmt.Errorf("checking is %q enabled: %w", l.selector, err)
	}

	return enabled, nil
}

// IsDisabled returns true if the element matches the locator's
// selector and is disabled. Otherwise, returns false.
func (l *Locator) IsDisabled(opts *FrameIsDisabledOptions) (bool, error) {
	l.log.Debugf("Locator:IsDisabled", "fid:%s furl:%q sel:%q opts:%+v", l.frame.ID(), l.frame.URL(), l.selector, opts)

	opts.Strict = true
	disabled, err := l.frame.isDisabled(l.selector, opts)
	if err != nil {
		return false, fmt.Errorf("checking is %q disabled: %w", l.selector, err)
	}

	return disabled, nil
}

View on GitHub (pinned to 01ffac6f24)