{"record":{"id":"0c0310aabd948b70","repo":"grafana/k6","slug":"unchecking-q-w-0c0310","errorCode":null,"errorMessage":"unchecking %q: %w","messagePattern":"unchecking %q: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/js/modules/k6/browser/common/locator.go","lineNumber":197,"sourceCode":"\topts.Strict = true\n\topts.retry = true\n\tif err := l.frame.check(l.selector, opts); err != nil {\n\t\treturn fmt.Errorf(\"checking %q: %w\", l.selector, err)\n\t}\n\n\tapplySlowMo(l.ctx)\n\n\treturn nil\n}\n\n// Uncheck on an element using locator's selector with strict mode on.\nfunc (l *Locator) Uncheck(opts *FrameUncheckOptions) error {\n\tl.log.Debugf(\"Locator:Uncheck\", \"fid:%s furl:%q sel:%q opts:%+v\", l.frame.ID(), l.frame.URL(), l.selector, opts)\n\n\topts.Strict = true\n\topts.retry = true\n\tif err := l.frame.uncheck(l.selector, opts); err != nil {\n\t\treturn fmt.Errorf(\"unchecking %q: %w\", l.selector, err)\n\t}\n\n\tapplySlowMo(l.ctx)\n\n\treturn nil\n}\n\n// IsChecked returns true if the element matches the locator's\n// selector and is checked. Otherwise, returns false.\nfunc (l *Locator) IsChecked(opts *FrameIsCheckedOptions) (bool, error) {\n\tl.log.Debugf(\"Locator:IsChecked\", \"fid:%s furl:%q sel:%q opts:%+v\", l.frame.ID(), l.frame.URL(), l.selector, opts)\n\n\topts.Strict = true\n\tchecked, err := l.frame.isChecked(l.selector, opts)\n\tif err != nil {\n\t\treturn false, fmt.Errorf(\"checking is %q checked: %w\", l.selector, err)\n\t}\n","sourceCodeStart":179,"sourceCodeEnd":215,"githubUrl":"https://github.com/grafana/k6/blob/01ffac6f245854c1b8adc6a69857c76a15f90022/internal/js/modules/k6/browser/common/locator.go#L179-L215","documentation":"Wrapped failure from Frame.uncheck while unchecking the element(s) matched by the locator's selector with strict mode forced on. Fires when the selector matches zero or multiple elements (strict violation), the element is not a checkbox/radio or is disabled, the action times out, or the underlying CDP call fails.","triggerScenarios":"Thrown at internal/js/modules/k6/browser/common/locator.go:197 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Use a selector that resolves to exactly one checkbox/radio element, or narrow it with .first()/.nth()/filter()","Ensure the element is rendered and enabled before unchecking (page.waitForSelector or locator.WaitFor)","Increase the per-action or browser-level timeout if the element animates in slowly"],"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"}