{"record":{"id":"f9e7718d1aad62b6","repo":"grafana/k6","slug":"tapping-w","errorCode":null,"errorMessage":"tapping: %w","messagePattern":"tapping: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/js/modules/k6/browser/common/touchscreen.go","lineNumber":30,"sourceCode":"type Touchscreen struct {\n\tctx      context.Context\n\tsession  session\n\tkeyboard *Keyboard\n}\n\n// NewTouchscreen returns a new TouchScreen.\nfunc NewTouchscreen(ctx context.Context, s session, k *Keyboard) *Touchscreen {\n\treturn &Touchscreen{\n\t\tctx:      ctx,\n\t\tsession:  s,\n\t\tkeyboard: k,\n\t}\n}\n\n// Tap dispatches a tap start and tap end event.\nfunc (t *Touchscreen) Tap(x float64, y float64) error {\n\tif err := t.tap(x, y); err != nil {\n\t\treturn fmt.Errorf(\"tapping: %w\", err)\n\t}\n\treturn nil\n}\n\nfunc (t *Touchscreen) tap(x float64, y float64) error {\n\ttouchStart := input.DispatchTouchEvent(\n\t\tinput.TouchStart,\n\t\t[]*input.TouchPoint{{X: x, Y: y}},\n\t).WithModifiers(\n\t\tinput.Modifier(t.keyboard.modifiers),\n\t)\n\tif err := touchStart.Do(cdp.WithExecutor(t.ctx, t.session)); err != nil {\n\t\treturn fmt.Errorf(\"touch start: %w\", err)\n\t}\n\n\ttouchEnd := input.DispatchTouchEvent(\n\t\tinput.TouchEnd,\n\t\t[]*input.TouchPoint{},","sourceCodeStart":12,"sourceCodeEnd":48,"githubUrl":"https://github.com/grafana/k6/blob/01ffac6f245854c1b8adc6a69857c76a15f90022/internal/js/modules/k6/browser/common/touchscreen.go#L12-L48","documentation":"Returned by Touchscreen.Tap when the underlying tap() helper fails. tap() dispatches exactly two CDP Input.dispatchTouchEvent actions (touchStart then touchEnd) with the current keyboard modifiers, so this error wraps a failure of either CDP dispatch. It fires when the touch event cannot be delivered — most commonly a broken/closed CDP session or an invalidated page target, since dispatchTouchEvent itself does little validation of coordinates.","triggerScenarios":"Thrown at internal/js/modules/k6/browser/common/touchscreen.go:30 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify the browser and page are still open before tapping","Retry the tap after the page reaches an interactive state","Check the wrapped error to see whether the touch start or touch end dispatch failed","Ensure the browser was launched with a mobile/touch-capable emulation if events are rejected"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"01ffac6f245854c1b8adc6a69857c76a15f90022","analyzedAt":"2026-08-18T03:05:52.393Z","contentChangedAt":"2026-08-18T03:05:52.393Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}