{"record":{"id":"70dfc6e674e7acdf","repo":"grafana/k6","slug":"filling-q-with-q-w-70dfc6","errorCode":null,"errorMessage":"filling %q with %q: %w","messagePattern":"filling %q with %q: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/js/modules/k6/browser/common/locator.go","lineNumber":311,"sourceCode":"\n\thidden, err := l.frame.isHidden(l.selector, &FrameIsHiddenOptions{Strict: true})\n\tif err != nil {\n\t\treturn false, fmt.Errorf(\"checking is %q hidden: %w\", l.selector, err)\n\t}\n\n\treturn hidden, nil\n}\n\n// Fill out the element using locator's selector with strict mode on.\nfunc (l *Locator) Fill(value string, opts *FrameFillOptions) error {\n\tl.log.Debugf(\n\t\t\"Locator:Fill\", \"fid:%s furl:%q sel:%q val:%q opts:%+v\",\n\t\tl.frame.ID(), l.frame.URL(), l.selector, value, opts,\n\t)\n\n\topts.Strict = true\n\tif err := l.frame.fill(l.selector, value, opts); err != nil {\n\t\treturn fmt.Errorf(\"filling %q with %q: %w\", l.selector, value, err)\n\t}\n\n\tapplySlowMo(l.ctx)\n\n\treturn nil\n}\n\n// LocatorFilterOptions allows filtering a [Locator] by various criteria.\n// It's similar to [LocatorOptions] but used for filtering existing locators.\ntype LocatorFilterOptions struct {\n\t*LocatorOptions\n}\n\n// Filter returns a new [Locator] after applying the options to the current one.\nfunc (l *Locator) Filter(opts *LocatorFilterOptions) *Locator {\n\treturn NewLocator(l.ctx, opts.LocatorOptions, l.selector, l.frame, l.log)\n}\n","sourceCodeStart":293,"sourceCodeEnd":329,"githubUrl":"https://github.com/grafana/k6/blob/01ffac6f245854c1b8adc6a69857c76a15f90022/internal/js/modules/k6/browser/common/locator.go#L293-L329","documentation":"Wrapped failure from Frame.fill while setting the input value of the element matched by the locator's selector (strict mode forced). Fires when the selector matches zero/multiple elements, the target is not an input/textarea/contenteditable element, the element is not visible or editable, or the CDP fill sequence fails.","triggerScenarios":"Thrown at internal/js/modules/k6/browser/common/locator.go:311 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Target an actual form control (input, textarea, contenteditable) with a unique selector","Wait for the field to be visible and enabled before filling","For non-fillable elements use type/click+type instead of fill"],"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"}