{"record":{"id":"86fd34881b1df3a3","repo":"grafana/k6","slug":"releasing-the-mouse-button-on-x-f-y-f-w","errorCode":null,"errorMessage":"releasing the mouse button on x:%f y:%f: %w","messagePattern":"releasing the mouse button on x:(.+?) y:(.+?): %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/js/modules/k6/browser/common/mouse.go","lineNumber":100,"sourceCode":"\treturn nil\n}\n\nfunc (m *Mouse) down(opts *MouseDownUpOptions) error {\n\tm.button = input.MouseButton(opts.Button)\n\taction := input.DispatchMouseEvent(input.MousePressed, 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 down: %w\", err)\n\t}\n\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.","sourceCodeStart":82,"sourceCodeEnd":118,"githubUrl":"https://github.com/grafana/k6/blob/01ffac6f245854c1b8adc6a69857c76a15f90022/internal/js/modules/k6/browser/common/mouse.go#L82-L118","documentation":"Wrapped failure from Mouse.up while releasing a mouse button at the current pointer position (m.x, m.y). Fires when the CDP Input.dispatchMouseEvent(MouseReleased) command fails, e.g. the session or target was closed while the button was held.","triggerScenarios":"Thrown at internal/js/modules/k6/browser/common/mouse.go:100 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Release the button before closing or navigating the page","Ensure the session is valid; pair every Down with an Up (defer the Up)","Re-raise/inspect the wrapped CDP error for connection-level causes"],"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"}