{"record":{"id":"79eba78b87c16101","repo":"grafana/k6","slug":"unknown-attribute-attr-name-must-be-one-of","errorCode":null,"errorMessage":"Unknown attribute \"${attr.name}\", must be one of ${kSupportedAttributes.map((a) => `\"${a}\"`).join(\", \")}.","messagePattern":"Unknown attribute \"(.+?)\", must be one of (.+?)\"`\\)\\.join\\(\", \"\\)\\}\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/js/modules/k6/browser/common/js/injected_script.js","lineNumber":1224,"sourceCode":"      }\n      case \"name\": {\n        if (attr.op === \"<truthy>\")\n          throw new Error(`\"name\" attribute must have a value`);\n        if (typeof attr.value !== \"string\" && !(attr.value instanceof RegExp))\n          throw new Error(`\"name\" attribute must be a string or a regular expression`);\n        options.name = attr.value;\n        options.nameOp = attr.op;\n        options.exact = attr.caseSensitive;\n        break;\n      }\n      case \"include-hidden\": {\n        validateSupportedValues(attr, [true, false]);\n        validateSupportedOp(attr, [\"<truthy>\", \"=\"]);\n        options.includeHidden = attr.op === \"<truthy>\" ? true : attr.value;\n        break;\n      }\n      default: {\n        throw new Error(`Unknown attribute \"${attr.name}\", must be one of ${kSupportedAttributes.map((a) => `\"${a}\"`).join(\", \")}.`);\n      }\n    }\n  }\n  return options;\n}\nfunction queryRole(scope, options, internal) {\n  const result = [];\n  const match = (element) => {\n    if (getAriaRole(element) !== options.role)\n      return;\n    if (options.selected !== void 0 && getAriaSelected(element) !== options.selected)\n      return;\n    if (options.checked !== void 0 && getAriaChecked(element) !== options.checked)\n      return;\n    if (options.pressed !== void 0 && getAriaPressed(element) !== options.pressed)\n      return;\n    if (options.expanded !== void 0 && getAriaExpanded(element) !== options.expanded)\n      return;","sourceCodeStart":1206,"sourceCodeEnd":1242,"githubUrl":"https://github.com/grafana/k6/blob/01ffac6f245854c1b8adc6a69857c76a15f90022/internal/js/modules/k6/browser/common/js/injected_script.js#L1206-L1242","documentation":"Frame.InputValue() (frame.go:1365) wraps the inputValue action failure as 'getting input value of %q'. The action waits for a selector match in the attached state within Timeout and evaluates element.value, but the injected JS first rejects nodes that are not <input>, <textarea>, or <select> (it throws 'Node is not an <input>, <textarea> or <select> element'). So the wrapped error is a selector timeout, strict violation, frame/context failure, or a wrong-element-type failure.","triggerScenarios":"Selector matches nothing before Timeout; multiple matches with Strict:true; the matched element is a div/span/custom widget rather than a real input control; the frame navigates during the read.","commonSituations":"Reading values from custom comboboxes/autocomplete widgets built from divs; reading before the app populates the field; querying the main frame for a control inside an iframe.","solutions":["Confirm the target is a real input/textarea/select: check the page markup or use page.evaluate to log document.querySelector(sel).tagName.","Wait for the element first: await page.waitForSelector(sel, { timeout: 10000 }).","For custom widgets, read the underlying hidden input's value or the widget's state via page.evaluate.","Call InputValue on the frame that owns the element."],"exampleFix":"// before\nconst v = await page.inputValue('#combo'); // div widget -> error\n\n// after\nconst v = await page.evaluate(`\n  document.querySelector('#combo input')?.value ?? ''\n`);","handlingStrategy":"try-catch","validationCode":"const tag = await page.evaluate(`\n  document.querySelector(sel)?.tagName ?? 'none'\n`);\nif (!['INPUT', 'TEXTAREA', 'SELECT'].includes(tag)) throw new Error(`${tag} has no input value`);","typeGuard":null,"tryCatchPattern":"try {\n  return await page.inputValue(sel, { timeout: 10000 });\n} catch (e) {\n  const msg = String(e);\n  if (msg.includes('input') && msg.includes('element')) return null; // wrong element type\n  if (msg.includes('timed out')) return null; // element absent\n  throw e;\n}","preventionTips":["Confirm the control is a real input/textarea/select before reading its value.","For custom widgets, locate the internal input element.","Wait for fields to populate before reading values."],"tags":["k6","browser","frame","inputvalue","selector","timeout"],"backgroundTag":"element-not-found-timeout","analyzedSha":"01ffac6f245854c1b8adc6a69857c76a15f90022","analyzedAt":"2026-08-18T03:05:52.393Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}