{"record":{"id":"d69f29dc6236f7bf","repo":"grafana/k6","slug":"checking-is-q-checked-w","errorCode":null,"errorMessage":"checking is %q checked: %w","messagePattern":"checking is %q checked: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/js/modules/k6/browser/common/locator.go","lineNumber":213,"sourceCode":"\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\n\treturn checked, nil\n}\n\n// IsEditable returns true if the element matches the locator's\n// selector and is Editable. Otherwise, returns false.\nfunc (l *Locator) IsEditable(opts *FrameIsEditableOptions) (bool, error) {\n\tl.log.Debugf(\"Locator:IsEditable\", \"fid:%s furl:%q sel:%q opts:%+v\", l.frame.ID(), l.frame.URL(), l.selector, opts)\n\n\topts.Strict = true\n\teditable, err := l.frame.isEditable(l.selector, opts)\n\tif err != nil {\n\t\treturn false, fmt.Errorf(\"checking is %q editable: %w\", l.selector, err)\n\t}\n\n\treturn editable, nil\n}","sourceCodeStart":195,"sourceCodeEnd":231,"githubUrl":"https://github.com/grafana/k6/blob/01ffac6f245854c1b8adc6a69857c76a15f90022/internal/js/modules/k6/browser/common/locator.go#L195-L231","documentation":"Wrapped failure from Frame.isChecked while querying the checked state of the element matching the locator's selector (strict mode forced). Fires when the selector matches nothing or more than one element, the element is not checkable, or the CDP state query fails — not when the element is simply unchecked (that returns false, nil).","triggerScenarios":"Thrown at internal/js/modules/k6/browser/common/locator.go:213 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Make the selector uniquely identify a single checkbox/radio input","Verify the element exists and is an input of type checkbox or radio before querying","Catch the error and distinguish 'not checkable / not found' from a genuine false result"],"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"}