{"record":{"id":"3cea9e7e66eebd30","repo":"grafana/k6","slug":"checking-element-is-checked-q-w","errorCode":null,"errorMessage":"checking element is checked %q: %w","messagePattern":"checking element is checked %q: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/js/modules/k6/browser/common/frame.go","lineNumber":743,"sourceCode":"\t}\n\tact := f.newPointerAction(\n\t\tselector, DOMElementStateAttached, opts.Strict, uncheck, &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// IsChecked returns true if the first element that matches the selector\n// is checked. Otherwise, returns false.\nfunc (f *Frame) IsChecked(selector string, opts *FrameIsCheckedOptions) (bool, error) {\n\tf.log.Debugf(\"Frame:IsChecked\", \"fid:%s furl:%q sel:%q\", f.ID(), f.URL(), selector)\n\n\tchecked, err := f.isChecked(selector, opts)\n\tif err != nil {\n\t\treturn false, fmt.Errorf(\"checking element is checked %q: %w\", selector, err)\n\t}\n\n\treturn checked, nil\n}\n\nfunc (f *Frame) isChecked(selector string, opts *FrameIsCheckedOptions) (bool, error) {\n\tisChecked := func(apiCtx context.Context, handle *ElementHandle) (any, error) {\n\t\tv, err := handle.isChecked(apiCtx, 0) // Zero timeout when checking state\n\t\tif errors.Is(err, ErrTimedOut) {      // We don't care about timeout errors here!\n\t\t\treturn v, nil\n\t\t}\n\t\treturn v, err\n\t}\n\tact := f.newAction(\n\t\tselector, DOMElementStateAttached, opts.Strict, isChecked, []string{}, false, withRetry, true, opts.Timeout,\n\t)\n\tv, err := call(f.ctx, act, opts.Timeout)\n\tif err != nil {","sourceCodeStart":725,"sourceCodeEnd":761,"githubUrl":"https://github.com/grafana/k6/blob/3fcf5388d78cb382f0c0d42ec556a06bfd1b8dee/internal/js/modules/k6/browser/common/frame.go#L725-L761","documentation":"Returned by Frame.IsChecked when reading the checked state of the first matching element fails. The wrap adds selector context to the underlying action error (element not attached, evaluation failure, or timeout in the state-read action).","triggerScenarios":"Thrown at internal/js/modules/k6/browser/common/frame.go:735 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Ensure the selector matches exactly one form control","Wait for the element to be attached before querying state","Retry after the form/DOM settles"],"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"}