grafana/k6 · error

double clicking on %q: %w

Error message

double clicking on %q: %w

What it means

Frame.Dblclick() runs a pointer action that waits for the element to be visible, stable and enabled, then dispatches a double click. This error wraps any failure of that pipeline: injected-script wait timeout ('timed out after Nms'), element covered/intercepted, strict-mode multiple matches, or non-actionable targets.

Source

Thrown at internal/js/modules/k6/browser/common/frame.go:797

	v, err := f.Evaluate(js)
	if err != nil {
		return "", fmt.Errorf("getting frame content: %w", err)
	}
	s, ok := v.(string)
	if !ok {
		return "", fmt.Errorf("getting frame content: expected string, got %T", v)
	}

	return s, nil
}

// Dblclick double clicks an element matching provided selector.
func (f *Frame) Dblclick(selector string, popts *FrameDblclickOptions) error {
	f.log.Debugf("Frame:DblClick", "fid:%s furl:%q sel:%q", f.ID(), f.URL(), selector)

	if err := f.dblclick(selector, popts); err != nil {
		return fmt.Errorf("double clicking on %q: %w", selector, err)
	}

	applySlowMo(f.ctx)

	return nil
}

// dblclick is like Dblclick but takes parsed options and neither throws
// an error, or applies slow motion.
func (f *Frame) dblclick(selector string, opts *FrameDblclickOptions) error {
	dblclick := func(_ context.Context, eh *ElementHandle, p *Position) (any, error) {
		return nil, eh.dblclick(p, opts.ToMouseClickOptions())
	}
	act := f.newPointerAction(
		selector, DOMElementStateAttached, opts.Strict, dblclick, &opts.ElementHandleBasePointerOptions,
	)
	if _, err := call(f.ctx, act, opts.Timeout); err != nil {
		return errorFromDOMError(err)

View on GitHub (pinned to 93accf6570)

Solutions

  1. Wait for visible state and pass a larger timeout to dblclick.
  2. Use a unique selector (data-testid) to satisfy strict mode.
  3. Dismiss/await overlays (spinners, masks) before double clicking.

Example fix

// before
frame.dblclick('tr.row'); // many rows -> strict failure

// after
await frame.waitForSelector('tr.row[data-id="42"]', { state: 'visible' });
frame.dblclick('tr.row[data-id="42"]', { timeout: 30000 });
Defensive patterns

Strategy: validation

Validate before calling

await frame.waitForSelector(sel, { state: 'visible', timeout: 30000 });

Try / catch

try {
  frame.dblclick(sel, { timeout: 30000 });
} catch (e) {
  if (/timed out/.test(e.message)) { /* element not actionable — investigate overlay/visibility */ }
}

Prevention

When it happens

Trigger: Element not rendered/visible within opts.Timeout; an overlay intercepts pointer events; selector matches several nodes with strict:true; the target does not accept double clicks (some inputs).

Common situations: Testing grid rows that open on double click while a loading mask is up; slow hydration in SPAs; duplicated selectors in tables; CI with reduced timeouts.

Related errors


AI-assisted analysis of grafana/k6@93accf6570 (2026-08-15). Data as JSON: /api/errors/f43ce1652e12c283. Report an issue: GitHub.