{"record":{"id":"467bb57105358c2a","repo":"grafana/k6","slug":"getting-input-value-of-q-w-467bb5","errorCode":null,"errorMessage":"getting input value of %q: %w","messagePattern":"getting input value of %q: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/js/modules/k6/browser/common/locator.go","lineNumber":515,"sourceCode":"\n\topts.Strict = true\n\ts, ok, err := l.frame.textContent(l.selector, opts)\n\tif err != nil {\n\t\treturn \"\", false, fmt.Errorf(\"getting text content of %q: %w\", l.selector, err)\n\t}\n\n\treturn s, ok, nil\n}\n\n// InputValue returns the element's input value that matches\n// the locator's selector with strict mode on.\nfunc (l *Locator) InputValue(opts *FrameInputValueOptions) (string, error) {\n\tl.log.Debugf(\"Locator:InputValue\", \"fid:%s furl:%q sel:%q opts:%+v\", l.frame.ID(), l.frame.URL(), l.selector, opts)\n\n\topts.Strict = true\n\tv, err := l.frame.inputValue(l.selector, opts)\n\tif err != nil {\n\t\treturn \"\", fmt.Errorf(\"getting input value of %q: %w\", l.selector, err)\n\t}\n\n\treturn v, nil\n}\n\n// SelectOption filters option values of the first element that matches\n// the locator's selector (with strict mode on), selects the options,\n// and returns the filtered options.\nfunc (l *Locator) SelectOption(values []any, opts *FrameSelectOptionOptions) ([]string, error) {\n\tl.log.Debugf(\"Locator:SelectOption\", \"fid:%s furl:%q sel:%q opts:%+v\", l.frame.ID(), l.frame.URL(), l.selector, opts)\n\n\topts.Strict = true\n\tv, err := l.frame.selectOption(l.selector, values, opts)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"selecting option on %q: %w\", l.selector, err)\n\t}\n\n\tapplySlowMo(l.ctx)","sourceCodeStart":497,"sourceCodeEnd":533,"githubUrl":"https://github.com/grafana/k6/blob/01ffac6f245854c1b8adc6a69857c76a15f90022/internal/js/modules/k6/browser/common/locator.go#L497-L533","documentation":"Wrapped failure from Frame.inputValue while reading the value of input/textarea/select elements matched by the locator's selector (strict mode forced). Fires on zero/multiple matches, when the element is not a form control, or when the CDP value evaluation fails.","triggerScenarios":"Thrown at internal/js/modules/k6/browser/common/locator.go:515 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Target an input, textarea, or select element with a unique selector","Wait for the field to be populated before reading its value","Use InnerText/TextContent for non-form-control elements"],"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"}