{"record":{"id":"5fa0dc4e0086c9b7","repo":"grafana/k6","slug":"getting-frame-element-w","errorCode":null,"errorMessage":"getting frame element: %w","messagePattern":"getting frame element: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/js/modules/k6/browser/common/frame.go","lineNumber":990,"sourceCode":"\t}\n\tact := f.newAction(\n\t\tselector, DOMElementStateAttached, opts.Strict, focus,\n\t\t[]string{}, false, withRetry, true, opts.Timeout,\n\t)\n\tif _, err := call(f.ctx, act, opts.Timeout); err != nil {\n\t\treturn errorFromDOMError(err)\n\t}\n\n\treturn nil\n}\n\n// 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) {","sourceCodeStart":972,"sourceCodeEnd":1008,"githubUrl":"https://github.com/grafana/k6/blob/93accf6570dcd306ca5e99cc44c393ee3797761b/internal/js/modules/k6/browser/common/frame.go#L972-L1008","documentation":"Error \"getting frame element: %w\" thrown in grafana/k6.","triggerScenarios":"Thrown at internal/js/modules/k6/browser/common/frame.go:990 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"}