{"record":{"id":"f3ca296c7998d347","repo":"grafana/k6","slug":"mouse-up-w","errorCode":null,"errorMessage":"mouse up: %w","messagePattern":"mouse up: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/js/modules/k6/browser/common/mouse.go","lineNumber":112,"sourceCode":"\treturn nil\n}\n\n// Up will trigger a MouseUp event in the browser.\nfunc (m *Mouse) Up(opts *MouseDownUpOptions) error {\n\tif err := m.up(opts); err != nil {\n\t\treturn fmt.Errorf(\"releasing the mouse button on x:%f y:%f: %w\", m.x, m.y, err)\n\t}\n\treturn nil\n}\n\nfunc (m *Mouse) up(opts *MouseDownUpOptions) error {\n\tm.button = input.None\n\taction := input.DispatchMouseEvent(input.MouseReleased, m.x, m.y).\n\t\tWithButton(input.MouseButton(opts.Button)).\n\t\tWithModifiers(input.Modifier(m.keyboard.modifiers)).\n\t\tWithClickCount(opts.ClickCount)\n\tif err := action.Do(cdp.WithExecutor(m.ctx, m.session)); err != nil {\n\t\treturn fmt.Errorf(\"mouse up: %w\", err)\n\t}\n\n\treturn nil\n}\n\n// Move will trigger a MouseMoved event in the browser.\nfunc (m *Mouse) Move(x float64, y float64, opts *MouseMoveOptions) error {\n\tif err := m.move(x, y, opts); err != nil {\n\t\treturn fmt.Errorf(\"moving the mouse pointer to x:%f y:%f: %w\", x, y, err)\n\t}\n\treturn nil\n}\n\nfunc (m *Mouse) move(x float64, y float64, opts *MouseMoveOptions) error {\n\tfromX := m.x\n\tfromY := m.y\n\tm.x = x\n\tm.y = y","sourceCodeStart":94,"sourceCodeEnd":130,"githubUrl":"https://github.com/grafana/k6/blob/01ffac6f245854c1b8adc6a69857c76a15f90022/internal/js/modules/k6/browser/common/mouse.go#L94-L130","documentation":"Low-level failure of the CDP Input.dispatchMouseEvent(MouseReleased) command. The handler resets the tracked button to None before dispatch, so this error indicates the protocol executor rejected the release — closed session, gone target, or canceled context — not stale button state.","triggerScenarios":"Thrown at internal/js/modules/k6/browser/common/mouse.go:112 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check that the page/session is still connected before releasing","Ensure Down/Up are issued within the same session lifetime","Inspect the wrapped error for context cancellation (iteration teardown)"],"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"}