{"record":{"id":"ba53fdb80e221b5c","repo":"grafana/k6","slug":"getting-text-content-of-q-w-ba53fd","errorCode":null,"errorMessage":"getting text content of %q: %w","messagePattern":"getting text content of %q: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/js/modules/k6/browser/common/locator.go","lineNumber":501,"sourceCode":"}\n\n// Nth will return the nth child of the element matching the locator's\n// selector.\nfunc (l *Locator) Nth(nth int) *Locator {\n\treturn NewLocator(l.ctx, nil, l.selector+\" >> nth=\"+strconv.Itoa(nth), l.frame, l.log)\n}\n\n// TextContent returns the element's text content that matches\n// the locator's selector with strict mode on. The second return\n// value is true if the returned text content is not null or empty,\n// and false otherwise.\nfunc (l *Locator) TextContent(opts *FrameTextContentOptions) (string, bool, error) {\n\tl.log.Debugf(\"Locator:TextContent\", \"fid:%s furl:%q sel:%q opts:%+v\", l.frame.ID(), l.frame.URL(), l.selector, opts)\n\n\topts.Strict = true\n\ts, ok, err := l.frame.textContent(l.selector, opts)\n\tif err != nil {\n\t\treturn \"\", false, fmt.Errorf(\"getting text content of %q: %w\", l.selector, err)\n\t}\n\n\treturn s, ok, nil\n}\n\n// InputValue returns the element's input value that matches\n// the locator's selector with strict mode on.\nfunc (l *Locator) InputValue(opts *FrameInputValueOptions) (string, error) {\n\tl.log.Debugf(\"Locator:InputValue\", \"fid:%s furl:%q sel:%q opts:%+v\", l.frame.ID(), l.frame.URL(), l.selector, opts)\n\n\topts.Strict = true\n\tv, err := l.frame.inputValue(l.selector, opts)\n\tif err != nil {\n\t\treturn \"\", fmt.Errorf(\"getting input value of %q: %w\", l.selector, err)\n\t}\n\n\treturn v, nil\n}","sourceCodeStart":483,"sourceCodeEnd":519,"githubUrl":"https://github.com/grafana/k6/blob/93accf6570dcd306ca5e99cc44c393ee3797761b/internal/js/modules/k6/browser/common/locator.go#L483-L519","documentation":"Error \"getting text content of %q: %w\" thrown in grafana/k6.","triggerScenarios":"Thrown at internal/js/modules/k6/browser/common/locator.go:501 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"}