{"record":{"id":"c822cd7b90af8148","repo":"grafana/k6","slug":"setting-checked-q-w","errorCode":null,"errorMessage":"setting checked %q: %w","messagePattern":"setting checked %q: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/js/modules/k6/browser/common/frame.go","lineNumber":701,"sourceCode":"\tsetChecked := func(apiCtx context.Context, handle *ElementHandle, p *Position) (any, error) {\n\t\treturn nil, handle.setChecked(apiCtx, checked, p)\n\t}\n\tact := f.newPointerAction(\n\t\tselector, DOMElementStateAttached, opts.Strict, setChecked, &opts.ElementHandleBasePointerOptions,\n\t)\n\tif _, err := call(f.ctx, act, opts.Timeout); err != nil {\n\t\treturn errorFromDOMError(err)\n\t}\n\n\treturn nil\n}\n\n// SetChecked sets the checked state of the first element found that matches the selector.\nfunc (f *Frame) SetChecked(selector string, checked bool, popts *FrameCheckOptions) error {\n\tf.log.Debugf(\"Frame:SetChecked\", \"fid:%s furl:%q sel:%q\", f.ID(), f.URL(), selector)\n\n\tif err := f.setChecked(selector, checked, popts); err != nil {\n\t\treturn fmt.Errorf(\"setting checked %q: %w\", selector, err)\n\t}\n\n\tapplySlowMo(f.ctx)\n\n\treturn nil\n}\n\n// Uncheck the first found element that matches the selector.\nfunc (f *Frame) Uncheck(selector string, popts *FrameUncheckOptions) error {\n\tf.log.Debugf(\"Frame:Uncheck\", \"fid:%s furl:%q sel:%q\", f.ID(), f.URL(), selector)\n\n\tif err := f.uncheck(selector, popts); err != nil {\n\t\treturn fmt.Errorf(\"unchecking %q: %w\", selector, err)\n\t}\n\n\tapplySlowMo(f.ctx)\n\n\treturn nil","sourceCodeStart":683,"sourceCodeEnd":719,"githubUrl":"https://github.com/grafana/k6/blob/3fcf5388d78cb382f0c0d42ec556a06bfd1b8dee/internal/js/modules/k6/browser/common/frame.go#L683-L719","documentation":"Returned by Frame.SetChecked after the internal setChecked pointer action fails. The wrapped error carries the cause: element not actionable (visible/enabled/editable), timeout, interception, or a state-change verification failure after clicking.","triggerScenarios":"Thrown at internal/js/modules/k6/browser/common/frame.go:693 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Ensure the element is an editable checkbox/radio that is visible and enabled","Increase the timeout","Use force:true to skip checks","Retry after DOM changes settle"],"exampleFix":null,"handlingStrategy":"retry","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"}