grafana/k6 · error
getting input value of
Error message
getting input value of %q: %w
What it means
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.
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
Defensive patterns
Strategy: try-catch
When it happens
Trigger: Thrown at internal/js/modules/k6/browser/common/locator.go:515 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of grafana/k6@01ffac6f24 (2026-08-18).
Data as JSON: /api/errors/467bb57105358c2a.
Report an issue: GitHub.
Appendix: source
Thrown at internal/js/modules/k6/browser/common/locator.go:515
opts.Strict = true
s, ok, err := l.frame.textContent(l.selector, opts)
if err != nil {
return "", false, fmt.Errorf("getting text content of %q: %w", l.selector, err)
}
return s, ok, nil
}
// InputValue returns the element's input value that matches
// the locator's selector with strict mode on.
func (l *Locator) InputValue(opts *FrameInputValueOptions) (string, error) {
l.log.Debugf("Locator:InputValue", "fid:%s furl:%q sel:%q opts:%+v", l.frame.ID(), l.frame.URL(), l.selector, opts)
opts.Strict = true
v, err := l.frame.inputValue(l.selector, opts)
if err != nil {
return "", fmt.Errorf("getting input value of %q: %w", l.selector, err)
}
return v, nil
}
// SelectOption filters option values of the first element that matches
// the locator's selector (with strict mode on), selects the options,
// and returns the filtered options.
func (l *Locator) SelectOption(values []any, opts *FrameSelectOptionOptions) ([]string, error) {
l.log.Debugf("Locator:SelectOption", "fid:%s furl:%q sel:%q opts:%+v", l.frame.ID(), l.frame.URL(), l.selector, opts)
opts.Strict = true
v, err := l.frame.selectOption(l.selector, values, opts)
if err != nil {
return nil, fmt.Errorf("selecting option on %q: %w", l.selector, err)
}
applySlowMo(l.ctx)View on GitHub (pinned to 01ffac6f24)