{"record":{"id":"b5754b303c3ecbba","repo":"grafana/k6","slug":"clicking-on-x-f-y-f-w","errorCode":null,"errorMessage":"clicking on x:%f y:%f: %w","messagePattern":"clicking on x:(.+?) y:(.+?): %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/js/modules/k6/browser/common/mouse.go","lineNumber":39,"sourceCode":"\tbutton          input.MouseButton\n}\n\n// NewMouse creates a new mouse.\nfunc NewMouse(ctx context.Context, s session, f *Frame, ts *TimeoutSettings, k *Keyboard) *Mouse {\n\treturn &Mouse{\n\t\tctx:             ctx,\n\t\tsession:         s,\n\t\tframe:           f,\n\t\ttimeoutSettings: ts,\n\t\tkeyboard:        k,\n\t\tbutton:          input.None,\n\t}\n}\n\n// Click will trigger a series of MouseMove, MouseDown and MouseUp events in the browser.\nfunc (m *Mouse) Click(x float64, y float64, opts *MouseClickOptions) error {\n\tif err := m.click(x, y, opts); err != nil {\n\t\treturn fmt.Errorf(\"clicking on x:%f y:%f: %w\", x, y, err)\n\t}\n\treturn nil\n}\n\nfunc (m *Mouse) click(x float64, y float64, opts *MouseClickOptions) error {\n\tmouseDownUpOpts := opts.ToMouseDownUpOptions()\n\tif err := m.move(x, y, NewMouseMoveOptions()); err != nil {\n\t\treturn err\n\t}\n\tfor i := 0; i < int(mouseDownUpOpts.ClickCount); i++ {\n\t\tif err := m.down(mouseDownUpOpts); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif opts.Delay != 0 {\n\t\t\tt := time.NewTimer(time.Duration(opts.Delay) * time.Millisecond)\n\t\t\tselect {\n\t\t\tcase <-m.ctx.Done():\n\t\t\t\tt.Stop()","sourceCodeStart":21,"sourceCodeEnd":57,"githubUrl":"https://github.com/grafana/k6/blob/01ffac6f245854c1b8adc6a69857c76a15f90022/internal/js/modules/k6/browser/common/mouse.go#L21-L57","documentation":"Wrapped failure from the internal Mouse.click sequence (move + down + up, with optional inter-click delay) at the given viewport coordinates. Fires when any of the underlying CDP Input.dispatchMouseEvent commands is rejected — commonly because the page/session was closed or the context was canceled mid-sequence.","triggerScenarios":"Thrown at internal/js/modules/k6/browser/common/mouse.go:39 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify the page and browser session are still alive before clicking","Ensure coordinates lie within the current viewport size","Check for k6 iteration teardown canceling the context during the click"],"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"}