grafana/k6 · error

parsing isVisible options of selector

Error message

parsing isVisible options of selector %q: %w

What it means

Generic parse wrapper for page.isVisible: the options argument failed to decode into common.FrameIsVisibleOptions; %q is the selector being tested. The wrapped error names the malformed option — isVisible accepts essentially no options, so any key is likely rejected.

Solutions

  1. Call isVisible(selector) without an options argument
  2. If a timeout was intended, note isVisible is a non-waiting check and takes no timeout
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at internal/js/modules/k6/browser/browser/page_mapping.go:336 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of grafana/k6@8d06114777 (2026-09-14). Data as JSON: /api/errors/659d79a083ae76c4. Report an issue: GitHub.

Appendix: source

Thrown at internal/js/modules/k6/browser/browser/page_mapping.go:337

				return nil, fmt.Errorf("parse isEnabled options of selector %q: %w", selector, err)
			}
			return promise(vu, func() (any, error) {
				return p.IsEnabled(selector, popts) //nolint:wrapcheck
			}), nil
		},
		"isHidden": func(selector string, opts sobek.Value) (*sobek.Promise, error) {
			popts, err := parseFrameIsHiddenOptions(rt, opts)
			if err != nil {
				return nil, fmt.Errorf("parse isHidden options of selector %q: %w", selector, err)
			}
			return promise(vu, func() (any, error) {
				return p.IsHidden(selector, popts) //nolint:wrapcheck
			}), nil
		},
		"isVisible": func(selector string, opts sobek.Value) (*sobek.Promise, error) {
			popts, err := parseFrameIsVisibleOptions(rt, opts)
			if err != nil {
				return nil, fmt.Errorf("parsing isVisible options of selector %q: %w", selector, err)
			}
			return promise(vu, func() (any, error) {
				return p.IsVisible(selector, popts) //nolint:wrapcheck
			}), nil
		},
		"keyboard": mapKeyboard(vu, p.GetKeyboard()),
		"locator": func(selector string, opts sobek.Value) *sobek.Object {
			ml := mapLocator(vu, p.Locator(selector, parseLocatorOptions(rt, opts)))
			return rt.ToValue(ml).ToObject(rt)
		},
		"frameLocator": func(selector string) *sobek.Object {
			mfl := mapFrameLocator(vu, p.FrameLocator(selector))
			return rt.ToValue(mfl).ToObject(rt)
		},
		"mainFrame": func() *sobek.Object {
			mf := mapFrame(vu, p.MainFrame())
			return rt.ToValue(mf).ToObject(rt)
		},

View on GitHub (pinned to 8d06114777)