{"record":{"id":"3432a12f0ed23dfd","repo":"grafana/k6","slug":"evaluating-pointer-action-w","errorCode":null,"errorMessage":"evaluating pointer action: %w","messagePattern":"evaluating pointer action: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/js/modules/k6/browser/common/element_handle.go","lineNumber":1775,"sourceCode":"\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\n\t\t// it (ie. running the actionability checks).\n\t\tif opts.Trial {\n\t\t\treturn nil, nil //nolint:nilnil\n\t\t}\n\n\t\tb := NewBarrier()\n\t\th.frame.manager.addBarrier(b)\n\t\tdefer h.frame.manager.removeBarrier(b)\n\t\tif res, err = fn(apiCtx, h, p); err != nil {\n\t\t\treturn nil, fmt.Errorf(\"evaluating pointer action: %w\", err)\n\t\t}\n\t\t// Do we need to wait for navigation to happen\n\t\tif !opts.NoWaitAfter {\n\t\t\tif err = b.Wait(apiCtx); err != nil {\n\t\t\t\treturn nil, fmt.Errorf(\"waiting for navigation: %w\", err)\n\t\t\t}\n\t\t}\n\n\t\treturn res, nil\n\t}\n\n\treturn func(apiCtx context.Context, resultCh chan any, errCh chan error) {\n\t\tif res, err := retryPointerAction(apiCtx, pointerFn, opts); err != nil {\n\t\t\tselect {\n\t\t\tcase <-apiCtx.Done():\n\t\t\tcase errCh <- err:\n\t\t\t}\n\t\t} else {","sourceCodeStart":1757,"sourceCodeEnd":1793,"githubUrl":"https://github.com/grafana/k6/blob/93accf6570dcd306ca5e99cc44c393ee3797761b/internal/js/modules/k6/browser/common/element_handle.go#L1757-L1793","documentation":"All pointer-action checks passed and the actual action closure ran (fn(apiCtx, h, p) — the mouse click/dblclick/hover or touch tap dispatch) but returned an error. This is the CDP input-dispatch stage: Input.dispatchMouseEvent/dispatchTouchEvent failed, the session was closed, or the action closure's own work (e.g. mouse down/up sequence) failed. Distinct from actionability errors: here the browser rejected or could not deliver the input event.","triggerScenarios":"Page or browser target closed/crashed between the checks and the dispatch; CDP session dropped (browser killed, connection lost); input dispatch rejected by a defunct target; system under such load that the browser process dies mid-action.","commonSituations":"Browser OOM in CI containers during heavy pages; closing the page in another concurrent operation while clicking; crashing chromium due to GPU/sandbox issues (--disable-gpu or headless quirks); long soak tests leaking pages until the browser dies.","solutions":["Check whether the browser/page is still alive (browser logs, K6_BROWSER_LOG=debug) and restart the browser context if crashed","Rule out resource exhaustion: raise container memory, close pages/contexts you no longer use","Retry the action once after re-acquiring the element — transient session drops often succeed on retry","If chromium sandbox/GPU crashes recur, try headless mode or adjust browser launch flags"],"exampleFix":null,"handlingStrategy":"retry","validationCode":"// ensure the page is alive before dispatching input\nif (!page.url()) throw new Error('page is closed'); // simple liveness probe","typeGuard":null,"tryCatchPattern":"try {\n  el.click();\n} catch (e) {\n  if (String(e).includes('evaluating pointer action')) {\n    // input dispatch failed (session/target drop): one retry after re-query\n    page.waitForSelector(sel, { state: 'visible' }).click();\n  } else {\n    throw e;\n  }\n}","preventionTips":["Close unused pages/contexts so chromium does not run out of memory","Do not close the page while actions are in flight","Investigate recurring dispatch failures with browser debug logs"],"tags":["browser","cdp","input-dispatch","crash","pointer-events"],"backgroundTag":null,"analyzedSha":"93accf6570dcd306ca5e99cc44c393ee3797761b","analyzedAt":"2026-08-15T21:23:27.118Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}