grafana/k6 · error

double clicking on

Error message

double clicking on %q: %w

What it means

Returned by Locator.Dblclick when the double-click action on the element matched by the locator fails; strict mode is on, so common causes are zero or multiple matching elements, the element being invisible, or the frame being detached. The input at fault is the locator's selector.

Solutions

  1. Make the selector resolve to exactly one visible element
  2. Increase the timeout option to give the element time to become actionable
  3. Retry the interaction after waiting for the element's stability (visibility, enabled state)
Defensive patterns

Strategy: retry

When it happens

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

Appendix: source

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

func (l *Locator) ContentFrame() *FrameLocator {
	return NewFrameLocator(l.ctx, l.selector, l.frame, l.log)
}

// Count APIs do not wait for the element to be present. It also does not set
// strict to true, allowing it to return the total number of elements matching
// the selector.
func (l *Locator) Count() (int, error) {
	return l.frame.count(l.selector)
}

// Dblclick double clicks on an element using locator's selector with strict mode on.
func (l *Locator) Dblclick(opts *FrameDblclickOptions) error {
	l.log.Debugf("Locator:Dblclick", "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.dblclick(l.selector, opts); err != nil {
		return fmt.Errorf("double clicking on %q: %w", l.selector, err)
	}

	applySlowMo(l.ctx)

	return nil
}

func (l *Locator) Evaluate(pageFunc string, args ...any) (any, error) {
	return l.frame.evaluateWithSelector(l.selector, pageFunc, args...)
}

func (l *Locator) EvaluateHandle(pageFunc string, args ...any) (JSHandleAPI, error) {
	return l.frame.evaluateHandleWithSelector(l.selector, pageFunc, args...)
}

// SetChecked sets the checked state of the element using locator's selector
// with strict mode on.
func (l *Locator) SetChecked(checked bool, opts *FrameCheckOptions) error {

View on GitHub (pinned to 01ffac6f24)