{"record":{"id":"ee5067d9a932a8b0","repo":"grafana/k6","slug":"attr-name-does-not-support-attr-op-match","errorCode":null,"errorMessage":"\"${attr.name}\" does not support \"${attr.op}\" matcher","messagePattern":"\"(.+?)\" does not support \"(.+?)\" matcher","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/js/modules/k6/browser/common/js/injected_script.js","lineNumber":1158,"sourceCode":"  if (!result.name && !result.attributes.length)\n    throw new InvalidSelectorError(`Error while parsing selector \\`${selector}\\` - selector cannot be empty`);\n  return result;\n}\n\n// packages/injected/src/roleSelectorEngine.ts\nvar kSupportedAttributes = [\"selected\", \"checked\", \"pressed\", \"expanded\", \"level\", \"disabled\", \"name\", \"include-hidden\"];\nkSupportedAttributes.sort();\nfunction validateSupportedRole(attr, roles, role) {\n  if (!roles.includes(role))\n    throw new Error(`\"${attr}\" attribute is only supported for roles: ${roles.slice().sort().map((role2) => `\"${role2}\"`).join(\", \")}`);\n}\nfunction validateSupportedValues(attr, values) {\n  if (attr.op !== \"<truthy>\" && !values.includes(attr.value))\n    throw new Error(`\"${attr.name}\" must be one of ${values.map((v) => JSON.stringify(v)).join(\", \")}`);\n}\nfunction validateSupportedOp(attr, ops) {\n  if (!ops.includes(attr.op))\n    throw new Error(`\"${attr.name}\" does not support \"${attr.op}\" matcher`);\n}\nfunction validateAttributes(attrs, role) {\n  const options = { role };\n  for (const attr of attrs) {\n    switch (attr.name) {\n      case \"checked\": {\n        validateSupportedRole(attr.name, kAriaCheckedRoles, role);\n        validateSupportedValues(attr, [true, false, \"mixed\"]);\n        validateSupportedOp(attr, [\"<truthy>\", \"=\"]);\n        options.checked = attr.op === \"<truthy>\" ? true : attr.value;\n        break;\n      }\n      case \"pressed\": {\n        validateSupportedRole(attr.name, kAriaPressedRoles, role);\n        validateSupportedValues(attr, [true, false, \"mixed\"]);\n        validateSupportedOp(attr, [\"<truthy>\", \"=\"]);\n        options.pressed = attr.op === \"<truthy>\" ? true : attr.value;\n        break;","sourceCodeStart":1140,"sourceCodeEnd":1176,"githubUrl":"https://github.com/grafana/k6/blob/01ffac6f245854c1b8adc6a69857c76a15f90022/internal/js/modules/k6/browser/common/js/injected_script.js#L1140-L1176","documentation":"Frame.InnerHTML() (frame.go:1294) wraps failures of the innerHTML action with 'getting inner HTML of %q'. The action waits for a selector match in the attached state within Timeout and evaluates element.innerHTML in the page. Wrapped causes are selector timeouts, strict-mode violations, frame/context destruction during evaluation, or page-side exceptions thrown by overridden innerHTML getters.","triggerScenarios":"Selector matches nothing before Timeout; Strict:true and multiple elements match; iframe navigates while the value is being read; page scripts define a throwing innerText/innerHTML getter on the prototype.","commonSituations":"Scraping markup of lazily rendered widgets before they mount; reading innerHTML right after actions that trigger rerenders/navigation; querying the main frame for elements that live in an iframe.","solutions":["Wait for the element before reading: await page.waitForSelector(sel, { timeout: 10000 }).","Target the correct frame object for iframe content.","Use a unique selector or locator API to avoid strict-mode ambiguity.","Increase Timeout for slow-rendering apps: page.innerHTML(sel, { timeout: 60000 })."],"exampleFix":"// before\nconst html = await page.innerHTML('#results');\n\n// after\nawait page.waitForSelector('#results', { state: 'attached', timeout: 10000 });\nconst html = await page.innerHTML('#results');","handlingStrategy":"try-catch","validationCode":"await page.waitForSelector('#results', { state: 'attached', timeout: 5000 });","typeGuard":null,"tryCatchPattern":"try {\n  return await page.innerHTML(sel, { timeout: 10000 });\n} catch (e) {\n  if (String(e).startsWith('getting inner HTML')) return ''; // element not there yet\n  throw e;\n}","preventionTips":["Wait for the element before reading its markup.","Read from the owning frame.","Use unique selectors under strict mode."],"tags":["k6","browser","frame","innerhtml","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"}