{"record":{"id":"fee4e82822831bdd","repo":"grafana/k6","slug":"touch-start-w","errorCode":null,"errorMessage":"touch start: %w","messagePattern":"touch start: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/js/modules/k6/browser/common/touchscreen.go","lineNumber":43,"sourceCode":"}\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{},\n\t).WithModifiers(\n\t\tinput.Modifier(t.keyboard.modifiers),\n\t)\n\tif err := touchEnd.Do(cdp.WithExecutor(t.ctx, t.session)); err != nil {\n\t\treturn fmt.Errorf(\"touch end: %w\", err)\n\t}\n\n\treturn nil\n}\n","sourceCodeStart":25,"sourceCodeEnd":58,"githubUrl":"https://github.com/grafana/k6/blob/01ffac6f245854c1b8adc6a69857c76a15f90022/internal/js/modules/k6/browser/common/touchscreen.go#L25-L58","documentation":"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.","triggerScenarios":"Thrown at internal/js/modules/k6/browser/common/touchscreen.go:43 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Ensure the page/target is alive and the CDP session healthy before tapping","Retry the tap operation after re-establishing a stable page state","Inspect the appended CDP error for the exact dispatchTouchEvent rejection reason"],"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"}