{"record":{"id":"989a01b9ac01c74a","repo":"grafana/k6","slug":"pointer-action-w","errorCode":null,"errorMessage":"pointer action: %w","messagePattern":"pointer action: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/js/modules/k6/browser/common/element_handle.go","lineNumber":1751,"sourceCode":"\t\t\t\tevalOptions{forceCallable: true, returnByValue: false},\n\t\t\t\tjs.ScrollIntoView,\n\t\t\t\tsopts,\n\t\t\t)\n\t\t}\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"scrolling element into view: %w\", err)\n\t\t}\n\n\t\t// Get the clickable point\n\t\tif p != nil {\n\t\t\tp, err = h.offsetPosition(apiCtx, opts.Position)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, fmt.Errorf(\"getting element position: %w\", err)\n\t\t\t}\n\t\t} else {\n\t\t\tp, err = h.clickablePoint()\n\t\t\tif err != nil {\n\t\t\t\treturn nil, fmt.Errorf(\"pointer action: %w\", err)\n\t\t\t}\n\t\t}\n\n\t\t// Further translation of the point might be necessary if the point\n\t\t// is still relative to the parent frame it is in and not the page.\n\t\t*p, err = h.translatePointToPage(apiCtx, *p)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"translating point to page: %w\", err)\n\t\t}\n\n\t\t// Do a final actionability check to see if element can receive events\n\t\t// at mouse position in question\n\t\tif !opts.Force {\n\t\t\tif ok, err := h.checkHitTargetAt(apiCtx, *p); !ok {\n\t\t\t\treturn nil, fmt.Errorf(\"checking hit target: %w\", err)\n\t\t\t}\n\t\t}\n\t\t// Are we only \"trialing\" the action but not actually performing","sourceCodeStart":1733,"sourceCodeEnd":1769,"githubUrl":"https://github.com/grafana/k6/blob/3fcf5388d78cb382f0c0d42ec556a06bfd1b8dee/internal/js/modules/k6/browser/common/element_handle.go#L1733-L1769","documentation":"Stage of the k6 browser module's pointer-action pipeline that resolves the element's clickable point when no custom position was given: clickablePoint() reads the element's BoundingBox and takes its center. This error (labelled 'pointer action') wraps that failing — the inner error is 'finding clickable point', caused by a missing bounding box (hidden element, zero-size element, detached node, or element inside an unrendered iframe).","triggerScenarios":"click()/dblclick()/hover() without position on an element with no rendered box: display:none, width/height 0 (e.g., an empty inline element), an <svg> or custom element not yet upgraded, or a node detached after passing earlier checks.","commonSituations":"Clicking placeholder elements before content renders; zero-size anchors used as JS hooks; elements that only get size after fonts/images load (CLS); virtualized list rows unmounted mid-action.","solutions":["Wait until the element has actual size: waitForSelector(sel, { state: 'visible' }) plus (if needed) a boundingBox retry loop checking width/height > 0.","Await font/image load: page.waitForLoadState('networkidle') before acting.","Re-query the handle right before the click to avoid detachment races.","If the element is intentionally zero-size, click a positioned parent or use { position } on an ancestor with a real box."],"exampleFix":"// before\nconst el = await page.$('#icon-button');\nawait el.click(); // zero-size until icon font loads\n\n// after\nawait page.waitForLoadState('networkidle');\nconst el = await page.waitForSelector('#icon-button', { state: 'visible' });\nawait el.click();","handlingStrategy":"validation","validationCode":"const box = await el.boundingBox();\nif (!box || box.width <= 0 || box.height <= 0) {\n  throw new Error(`element has no clickable box (${JSON.stringify(box)})`);\n}\nawait el.click();","typeGuard":"async function isClickable(el) {\n  const b = await el.boundingBox().catch(() => null);\n  return !!b && b.width > 0 && b.height > 0;\n}","tryCatchPattern":"try {\n  await el.click();\n} catch (e) {\n  if (String(e).includes('pointer action')) {\n    await page.waitForLoadState('networkidle');\n    el = await page.waitForSelector(sel, { state: 'visible' });\n    await el.click();\n  } else { throw e; }\n}","preventionTips":["Wait for fonts/images to load before clicking layout-dependent elements.","For zero-size hooks, click a sized parent instead."],"tags":["k6","browser","element-handle","pointer-action","bounding-box","not-visible"],"backgroundTag":"element-not-visible","analyzedSha":"3fcf5388d78cb382f0c0d42ec556a06bfd1b8dee","analyzedAt":"2026-08-18T03:05:52.393Z","contentChangedAt":"2026-08-18T03:05:52.393Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}