grafana/k6 · error
filling with
Error message
filling %q with %q: %w
What it means
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.
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
Defensive patterns
Strategy: try-catch
When it happens
Trigger: Thrown at internal/js/modules/k6/browser/common/locator.go:311 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/70dfc6e674e7acdf.
Report an issue: GitHub.
Appendix: source
Thrown at internal/js/modules/k6/browser/common/locator.go:311
hidden, err := l.frame.isHidden(l.selector, &FrameIsHiddenOptions{Strict: true})
if err != nil {
return false, fmt.Errorf("checking is %q hidden: %w", l.selector, err)
}
return hidden, nil
}
// Fill out the element using locator's selector with strict mode on.
func (l *Locator) Fill(value string, opts *FrameFillOptions) error {
l.log.Debugf(
"Locator:Fill", "fid:%s furl:%q sel:%q val:%q opts:%+v",
l.frame.ID(), l.frame.URL(), l.selector, value, opts,
)
opts.Strict = true
if err := l.frame.fill(l.selector, value, opts); err != nil {
return fmt.Errorf("filling %q with %q: %w", l.selector, value, err)
}
applySlowMo(l.ctx)
return nil
}
// LocatorFilterOptions allows filtering a [Locator] by various criteria.
// It's similar to [LocatorOptions] but used for filtering existing locators.
type LocatorFilterOptions struct {
*LocatorOptions
}
// Filter returns a new [Locator] after applying the options to the current one.
func (l *Locator) Filter(opts *LocatorFilterOptions) *Locator {
return NewLocator(l.ctx, opts.LocatorOptions, l.selector, l.frame, l.log)
}
View on GitHub (pinned to 01ffac6f24)