{"record":{"id":"6adaee97695bea93","repo":"grafana/k6","slug":"getting-attribute-q-of-q-w","errorCode":null,"errorMessage":"getting attribute %q of %q: %w","messagePattern":"getting attribute %q of %q: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/js/modules/k6/browser/common/frame.go","lineNumber":1002,"sourceCode":"// FrameElement returns the element handle for the frame.\nfunc (f *Frame) FrameElement() (*ElementHandle, error) {\n\tf.log.Debugf(\"Frame:FrameElement\", \"fid:%s furl:%q\", f.ID(), f.URL())\n\n\telement, err := f.page.getFrameElement(f)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"getting frame element: %w\", err)\n\t}\n\treturn element, nil\n}\n\n// GetAttribute of the first element found that matches the selector.\n// The second return value is true if the attribute exists, and false otherwise.\nfunc (f *Frame) GetAttribute(selector, name string, popts *FrameBaseOptions) (string, bool, error) {\n\tf.log.Debugf(\"Frame:GetAttribute\", \"fid:%s furl:%q sel:%q name:%s\", f.ID(), f.URL(), selector, name)\n\n\ts, ok, err := f.getAttribute(selector, name, popts)\n\tif err != nil {\n\t\treturn \"\", false, fmt.Errorf(\"getting attribute %q of %q: %w\", name, selector, err)\n\t}\n\n\treturn s, ok, nil\n}\n\nfunc (f *Frame) getAttribute(selector, name string, opts *FrameBaseOptions) (string, bool, error) {\n\tgetAttribute := func(apiCtx context.Context, handle *ElementHandle) (any, error) {\n\t\treturn handle.getAttribute(apiCtx, name)\n\t}\n\tact := f.newAction(\n\t\tselector, DOMElementStateAttached, opts.Strict, getAttribute,\n\t\t[]string{}, false, withRetry, true, opts.Timeout,\n\t)\n\tv, err := call(f.ctx, act, opts.Timeout)\n\tif err != nil {\n\t\treturn \"\", false, errorFromDOMError(err)\n\t}\n\tif v == nil {","sourceCodeStart":984,"sourceCodeEnd":1020,"githubUrl":"https://github.com/grafana/k6/blob/93accf6570dcd306ca5e99cc44c393ee3797761b/internal/js/modules/k6/browser/common/frame.go#L984-L1020","documentation":"Error \"getting attribute %q of %q: %w\" thrown in grafana/k6.","triggerScenarios":"Thrown at internal/js/modules/k6/browser/common/frame.go:1002 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"}