{"record":{"id":"4c84f2321b8f0341","repo":"grafana/k6","slug":"getting-inner-html-of-q-w-4c84f2","errorCode":null,"errorMessage":"getting inner HTML of %q: %w","messagePattern":"getting inner HTML of %q: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/js/modules/k6/browser/common/locator.go","lineNumber":459,"sourceCode":"}\n\n// FrameLocator creates a frame locator for an iframe matching the given selector\n// within the current locator's scope.\nfunc (l *Locator) FrameLocator(selector string) *FrameLocator {\n\tl.log.Debugf(\"Locator:FrameLocator\", \"selector:%q childSelector:%q\", l.selector, selector)\n\n\treturn l.Locator(selector, nil).ContentFrame()\n}\n\n// InnerHTML returns the element's inner HTML that matches\n// the locator's selector with strict mode on.\nfunc (l *Locator) InnerHTML(opts *FrameInnerHTMLOptions) (string, error) {\n\tl.log.Debugf(\"Locator:InnerHTML\", \"fid:%s furl:%q sel:%q opts:%+v\", l.frame.ID(), l.frame.URL(), l.selector, opts)\n\n\topts.Strict = true\n\ts, err := l.frame.innerHTML(l.selector, opts)\n\tif err != nil {\n\t\treturn \"\", fmt.Errorf(\"getting inner HTML of %q: %w\", l.selector, err)\n\t}\n\n\treturn s, nil\n}\n\n// InnerText returns the element's inner text that matches\n// the locator's selector with strict mode on.\nfunc (l *Locator) InnerText(opts *FrameInnerTextOptions) (string, error) {\n\tl.log.Debugf(\"Locator:InnerText\", \"fid:%s furl:%q sel:%q opts:%+v\", l.frame.ID(), l.frame.URL(), l.selector, opts)\n\n\topts.Strict = true\n\ts, err := l.frame.innerText(l.selector, opts)\n\tif err != nil {\n\t\treturn \"\", fmt.Errorf(\"getting inner text of %q: %w\", l.selector, err)\n\t}\n\n\treturn s, nil\n}","sourceCodeStart":441,"sourceCodeEnd":477,"githubUrl":"https://github.com/grafana/k6/blob/93accf6570dcd306ca5e99cc44c393ee3797761b/internal/js/modules/k6/browser/common/locator.go#L441-L477","documentation":"Error \"getting inner HTML of %q: %w\" thrown in grafana/k6.","triggerScenarios":"Thrown at internal/js/modules/k6/browser/common/locator.go:459 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"93accf6570dcd306ca5e99cc44c393ee3797761b","analyzedAt":"2026-08-15T21:23:27.118Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}