grafana/k6 · error

getting inner HTML of %q: %w

Error message

getting inner HTML of %q: %w

What it means

Error "getting inner HTML of %q: %w" thrown in grafana/k6.

Source

Thrown at internal/js/modules/k6/browser/common/locator.go:459

}

// FrameLocator creates a frame locator for an iframe matching the given selector
// within the current locator's scope.
func (l *Locator) FrameLocator(selector string) *FrameLocator {
	l.log.Debugf("Locator:FrameLocator", "selector:%q childSelector:%q", l.selector, selector)

	return l.Locator(selector, nil).ContentFrame()
}

// InnerHTML returns the element's inner HTML that matches
// the locator's selector with strict mode on.
func (l *Locator) InnerHTML(opts *FrameInnerHTMLOptions) (string, error) {
	l.log.Debugf("Locator:InnerHTML", "fid:%s furl:%q sel:%q opts:%+v", l.frame.ID(), l.frame.URL(), l.selector, opts)

	opts.Strict = true
	s, err := l.frame.innerHTML(l.selector, opts)
	if err != nil {
		return "", fmt.Errorf("getting inner HTML of %q: %w", l.selector, err)
	}

	return s, nil
}

// InnerText returns the element's inner text that matches
// the locator's selector with strict mode on.
func (l *Locator) InnerText(opts *FrameInnerTextOptions) (string, error) {
	l.log.Debugf("Locator:InnerText", "fid:%s furl:%q sel:%q opts:%+v", l.frame.ID(), l.frame.URL(), l.selector, opts)

	opts.Strict = true
	s, err := l.frame.innerText(l.selector, opts)
	if err != nil {
		return "", fmt.Errorf("getting inner text of %q: %w", l.selector, err)
	}

	return s, nil
}

View on GitHub (pinned to 93accf6570)

When it happens

Trigger: Thrown at internal/js/modules/k6/browser/common/locator.go:459 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of grafana/k6@93accf6570 (2026-08-15). Data as JSON: /api/errors/4c84f2321b8f0341. Report an issue: GitHub.