grafana/k6 · error

touch start

Error message

touch start: %w

What it means

Raised inside Touchscreen.tap when the first of two CDP calls — Input.dispatchTouchEvent with type=touchStart and a single TouchPoint at (x, y) carrying the keyboard's current modifiers — fails to execute. This is a protocol-level failure of the press half of a tap; it fires when the CDP session cannot deliver the event (closed target, dead session) rather than for invalid coordinates.

Solutions

  1. Ensure the page/target is alive and the CDP session healthy before tapping
  2. Retry the tap operation after re-establishing a stable page state
  3. Inspect the appended CDP error for the exact dispatchTouchEvent rejection reason
Defensive patterns

Strategy: try-catch

When it happens

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

Appendix: source

Thrown at internal/js/modules/k6/browser/common/touchscreen.go:43

}

// Tap dispatches a tap start and tap end event.
func (t *Touchscreen) Tap(x float64, y float64) error {
	if err := t.tap(x, y); err != nil {
		return fmt.Errorf("tapping: %w", err)
	}
	return nil
}

func (t *Touchscreen) tap(x float64, y float64) error {
	touchStart := input.DispatchTouchEvent(
		input.TouchStart,
		[]*input.TouchPoint{{X: x, Y: y}},
	).WithModifiers(
		input.Modifier(t.keyboard.modifiers),
	)
	if err := touchStart.Do(cdp.WithExecutor(t.ctx, t.session)); err != nil {
		return fmt.Errorf("touch start: %w", err)
	}

	touchEnd := input.DispatchTouchEvent(
		input.TouchEnd,
		[]*input.TouchPoint{},
	).WithModifiers(
		input.Modifier(t.keyboard.modifiers),
	)
	if err := touchEnd.Do(cdp.WithExecutor(t.ctx, t.session)); err != nil {
		return fmt.Errorf("touch end: %w", err)
	}

	return nil
}

View on GitHub (pinned to 01ffac6f24)