{"record":{"id":"9d0f55037138aac9","repo":"grafana/k6","slug":"parsing-element-click-options-w","errorCode":null,"errorMessage":"parsing element click options: %w","messagePattern":"parsing element click options: %w","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/js/modules/k6/browser/browser/element_handle_mapping.go","lineNumber":44,"sourceCode":"\t\t\t\tbox, err := eh.BoundingBox()\n\t\t\t\t// We want to avoid errors when an element is not visible or detached and instead\n\t\t\t\t// opt to return a nil rectangle -- this matches Playwright's behaviour.\n\t\t\t\tif errors.Is(err, common.ErrElementNotVisible) || errors.Is(err, common.ErrElementNotAttachedToDOM) {\n\t\t\t\t\treturn nil, nil\n\t\t\t\t}\n\t\t\t\treturn box, err\n\t\t\t})\n\t\t},\n\t\t\"check\": func(opts sobek.Value) (*sobek.Promise, error) {\n\t\t\tpopts, err := parseElementHandleSetCheckedOptions(rt, opts, eh.DefaultTimeout())\n\t\t\tif err != nil {\n\t\t\t\treturn nil, fmt.Errorf(\"parsing check options: %w\", err)\n\t\t\t}\n\t\t\treturn promise(vu, func() (any, error) {\n\t\t\t\treturn nil, eh.Check(popts) //nolint:wrapcheck\n\t\t\t}), nil\n\t\t},\n\t\t\"click\": func(opts sobek.Value) (*sobek.Promise, error) {\n\t\t\tpopts, err := parseElementHandleClickOptions(rt, opts, eh.Timeout())\n\t\t\tif err != nil {\n\t\t\t\treturn nil, fmt.Errorf(\"parsing element click options: %w\", err)\n\t\t\t}\n\n\t\t\treturn promise(vu, func() (any, error) {\n\t\t\t\terr := eh.Click(popts)\n\t\t\t\treturn nil, err //nolint:wrapcheck\n\t\t\t}), nil\n\t\t},\n\t\t\"contentFrame\": func() *sobek.Promise {\n\t\t\treturn promise(vu, func() (any, error) {\n\t\t\t\tf, err := eh.ContentFrame()\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn nil, err //nolint:wrapcheck\n\t\t\t\t}\n\t\t\t\treturn mapFrame(vu, f), nil\n\t\t\t})","sourceCodeStart":26,"sourceCodeEnd":62,"githubUrl":"https://github.com/grafana/k6/blob/3fcf5388d78cb382f0c0d42ec556a06bfd1b8dee/internal/js/modules/k6/browser/browser/element_handle_mapping.go#L26-L62","documentation":"Generic parse wrapper for elementHandle.click: the options argument failed to decode into common.ElementHandleClickOptions (fields like button, clickCount, delay, modifiers, position, timeout, noWaitAfter, force). The wrapped error names the malformed field.","triggerScenarios":"Thrown at internal/js/modules/k6/browser/browser/element_handle_mapping.go:40 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check the wrapped error for the failing option key","Verify types: button is 'left'|'right'|'middle', clickCount/delay/timeout are numbers, modifiers an array of strings","Compare against the click options in the browser module docs"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"3fcf5388d78cb382f0c0d42ec556a06bfd1b8dee","analyzedAt":"2026-08-18T03:05:52.393Z","contentChangedAt":"2026-08-18T03:05:52.393Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}