{"record":{"id":"261a8eb571bfdb2b","repo":"grafana/k6","slug":"missing-required-argument-title","errorCode":null,"errorMessage":"missing required argument 'title'","messagePattern":"missing required argument 'title'","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/js/modules/k6/browser/browser/frame_locator_mapping.go","lineNumber":71,"sourceCode":"\t\t\t\treturn nil, errors.New(\"missing required argument 'testId'\")\n\t\t\t}\n\t\t\tptestID := parseStringOrRegex(testID, false)\n\n\t\t\tml := mapLocator(vu, fl.GetByTestID(ptestID))\n\t\t\treturn rt.ToValue(ml).ToObject(rt), nil\n\t\t},\n\t\t\"getByText\": func(text sobek.Value, opts sobek.Value) (*sobek.Object, error) {\n\t\t\tif k6common.IsNullish(text) {\n\t\t\t\treturn nil, errors.New(\"missing required argument 'text'\")\n\t\t\t}\n\t\t\tptext, popts := parseGetByBaseOptions(vu.Context(), text, true, opts)\n\n\t\t\tml := mapLocator(vu, fl.GetByText(ptext, popts))\n\t\t\treturn rt.ToValue(ml).ToObject(rt), nil\n\t\t},\n\t\t\"getByTitle\": func(title sobek.Value, opts sobek.Value) (*sobek.Object, error) {\n\t\t\tif k6common.IsNullish(title) {\n\t\t\t\treturn nil, errors.New(\"missing required argument 'title'\")\n\t\t\t}\n\t\t\tptitle, popts := parseGetByBaseOptions(vu.Context(), title, false, opts)\n\n\t\t\tml := mapLocator(vu, fl.GetByTitle(ptitle, popts))\n\t\t\treturn rt.ToValue(ml).ToObject(rt), nil\n\t\t},\n\t\t\"locator\": func(selector string, opts sobek.Value) mapping {\n\t\t\treturn mapLocator(vu, fl.Locator(selector, parseLocatorOptions(rt, opts)))\n\t\t},\n\t\t\"frameLocator\": func(selector string) *sobek.Object {\n\t\t\tmfl := mapFrameLocator(vu, fl.FrameLocator(selector))\n\t\t\treturn rt.ToValue(mfl).ToObject(rt)\n\t\t},\n\t}\n}\n","sourceCodeStart":53,"sourceCodeEnd":87,"githubUrl":"https://github.com/grafana/k6/blob/01ffac6f245854c1b8adc6a69857c76a15f90022/internal/js/modules/k6/browser/browser/frame_locator_mapping.go#L53-L87","documentation":"FrameLocator.getByTitle(title, opts) requires a non-nullish first argument (internal/js/modules/k6/browser/browser/frame_locator_mapping.go:71). The title matches elements' title attribute inside the iframe and may be a string or RegExp. k6common.IsNullish rejects only undefined and null, so the error means the argument was omitted or explicitly nullish.","triggerScenarios":"`frameLocator('iframe#chart').getByTitle()` with no argument, passing `null`, or a title variable that resolved to undefined — for instance an object property that was renamed, or an unset __ENV variable. Not triggered by empty string.","commonSituations":"Tooltip / SVG title locators parameterized from shared constants files where a key is missing; refactor renames leaving stale references; data-driven rows without the title field.","solutions":["Pass the title (string or RegExp): `frameLocator('iframe#chart').getByTitle('Quarterly revenue')`","Default dynamic values: `getByTitle(t ?? 'Info')`","Pre-validate constants/data modules for required title strings"],"exampleFix":"// before\nconst tip = frameLocator('iframe#chart').getByTitle();\n\n// after\nconst tip = frameLocator('iframe#chart').getByTitle('Revenue chart');","handlingStrategy":"validation","validationCode":"const title = tips[tipKey];\nif (title == null) throw new Error(`getByTitle: title is required, got ${title}`);\nconst el = frameLocator('iframe#chart').getByTitle(title);","typeGuard":"const isTextOrRegex = (v) => v != null && (typeof v === 'string' || v instanceof RegExp);","tryCatchPattern":null,"preventionTips":["Keep title/tooltip strings in the same constants module as other selectors","Guard optional titles with an explicit branch instead of forwarding undefined","Lint for undefined identifiers to catch rename residue"],"tags":["k6","browser","frame-locator","locator","getby-title","missing-argument"],"backgroundTag":"missing-required-argument","analyzedSha":"01ffac6f245854c1b8adc6a69857c76a15f90022","analyzedAt":"2026-08-18T03:05:52.393Z","contentChangedAt":"2026-08-18T03:05:52.393Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}