{"record":{"id":"67249b839ce37117","repo":"grafana/k6","slug":"parsing-getattribute-options-w","errorCode":null,"errorMessage":"parsing getAttribute options: %w","messagePattern":"parsing getAttribute options: %w","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"info","filePath":"internal/js/modules/k6/browser/browser/frame_mapping.go","lineNumber":125,"sourceCode":"\t\t\t\treturn nil, fmt.Errorf(\"parsing focus options: %w\", err)\n\t\t\t}\n\t\t\treturn promise(vu, func() (any, error) {\n\t\t\t\treturn nil, f.Focus(selector, popts) //nolint:wrapcheck\n\t\t\t}), nil\n\t\t},\n\t\t\"frameElement\": func() *sobek.Promise {\n\t\t\treturn promise(vu, func() (any, error) {\n\t\t\t\tfe, err := f.FrameElement()\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn nil, err //nolint:wrapcheck\n\t\t\t\t}\n\t\t\t\treturn mapElementHandle(vu, fe), nil\n\t\t\t})\n\t\t},\n\t\t\"getAttribute\": func(selector, name string, opts sobek.Value) (*sobek.Promise, error) {\n\t\t\tpopts := common.NewFrameBaseOptions(f.Timeout())\n\t\t\tif err := popts.Parse(vu.Context(), opts); err != nil {\n\t\t\t\treturn nil, fmt.Errorf(\"parsing getAttribute options: %w\", err)\n\t\t\t}\n\t\t\treturn promise(vu, func() (any, error) {\n\t\t\t\ts, ok, err := f.GetAttribute(selector, name, popts)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn nil, err //nolint:wrapcheck\n\t\t\t\t}\n\t\t\t\tif !ok {\n\t\t\t\t\treturn nil, nil //nolint:nilnil\n\t\t\t\t}\n\t\t\t\treturn s, nil\n\t\t\t}), nil\n\t\t},\n\t\t\"getByAltText\": func(alt sobek.Value, opts sobek.Value) (*sobek.Object, error) {\n\t\t\tif k6common.IsNullish(alt) {\n\t\t\t\treturn nil, errors.New(\"missing required argument 'altText'\")\n\t\t\t}\n\t\t\tpalt, popts := parseGetByBaseOptions(vu.Context(), alt, false, opts)\n","sourceCodeStart":107,"sourceCodeEnd":143,"githubUrl":"https://github.com/grafana/k6/blob/93accf6570dcd306ca5e99cc44c393ee3797761b/internal/js/modules/k6/browser/browser/frame_mapping.go#L107-L143","documentation":"Options passed to frame.getAttribute(selector, name, opts) failed to parse (frame_mapping.go:125). Like focus, it uses FrameBaseOptions whose Parse always returns nil - a defensive, effectively unreachable branch in this version.","triggerScenarios":"No getAttribute option ({ timeout, strict }) can trigger it today; values are coerced, never rejected.","commonSituations":"Not seen on stock k6; only relevant to forks or modified parsers.","solutions":["Pass only { timeout, strict }","Report to k6 if it fires on a stock build"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"const safeOpts = { timeout: Number(opts?.timeout) || undefined, strict: !!opts?.strict };","typeGuard":null,"tryCatchPattern":"try {\n  const v = await frame.getAttribute(sel, name, safeOpts);\n  if (v == null) console.warn(`${sel} has no attribute ${name}`);\n} catch (e) {\n  console.error(`getAttribute(${sel}, ${name}) failed: ${e.message}`);\n}","preventionTips":["Use only timeout/strict for getAttribute","Handle the null return (missing attribute) distinctly from errors"],"tags":["k6","browser","frame","options-parsing","getattribute"],"backgroundTag":null,"analyzedSha":"93accf6570dcd306ca5e99cc44c393ee3797761b","analyzedAt":"2026-08-15T21:23:27.118Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}