{"record":{"id":"4dc3f6fa47c10343","repo":"grafana/k6","slug":"parsing-focus-options-w","errorCode":null,"errorMessage":"parsing focus options: %w","messagePattern":"parsing focus options: %w","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"info","filePath":"internal/js/modules/k6/browser/browser/frame_mapping.go","lineNumber":107,"sourceCode":"\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 mapJSHandle(vu, jsh), nil\n\t\t\t}), nil\n\t\t},\n\t\t\"fill\": func(selector, value string, opts sobek.Value) (*sobek.Promise, error) {\n\t\t\tpopts := common.NewFrameFillOptions(f.Timeout())\n\t\t\tif err := popts.Parse(vu.Context(), opts); err != nil {\n\t\t\t\treturn nil, fmt.Errorf(\"parsing fill options: %w\", err)\n\t\t\t}\n\t\t\treturn promise(vu, func() (any, error) {\n\t\t\t\treturn nil, f.Fill(selector, value, popts) //nolint:wrapcheck\n\t\t\t}), nil\n\t\t},\n\t\t\"focus\": func(selector 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 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)","sourceCodeStart":89,"sourceCodeEnd":125,"githubUrl":"https://github.com/grafana/k6/blob/93accf6570dcd306ca5e99cc44c393ee3797761b/internal/js/modules/k6/browser/browser/frame_mapping.go#L89-L125","documentation":"Options passed to frame.focus(selector, opts) failed to parse (frame_mapping.go:107). FrameBaseOptions.Parse reads only 'strict' and 'timeout' and always returns nil in this codebase - this wrapper is defensive and effectively unreachable in the current version.","triggerScenarios":"No focus option value can trigger it today; both keys are coerced without erroring. Only an internal k6 change to the parser could make it fire.","commonSituations":"Essentially never hit on stock k6; relevant only when triaging k6 forks or unreleased parser changes.","solutions":["Use supported keys only: { timeout: 3000, strict: true }","If it fires on stock k6, report it with the script and k6 version"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"const safeOpts = { timeout: Number(opts?.timeout) || undefined, strict: !!opts?.strict };","typeGuard":null,"tryCatchPattern":"try {\n  await frame.focus(sel, safeOpts);\n} catch (e) {\n  console.error(`focus(${sel}) failed: ${e.message}`);\n}","preventionTips":["Use only timeout/strict for focus","Treat this specific message as a k6 defect signal, not a script bug"],"tags":["k6","browser","frame","options-parsing","focus"],"backgroundTag":null,"analyzedSha":"93accf6570dcd306ca5e99cc44c393ee3797761b","analyzedAt":"2026-08-15T21:23:27.118Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}