grafana/k6 · error

another element is intercepting with pointer action

Error message

another element is intercepting with pointer action

What it means

Mapped from 'error:intercept' by errorFromDOMError (element_handle.go:1896-1916). Before pointer actions (click, tap, hover-type interactions) k6 performs actionability checks: it verifies the target element would be the hit target at the click point. When a different element (overlay, sticky header, modal backdrop) would receive the pointer event instead, the action is aborted with this error.

Source

Thrown at internal/js/modules/k6/browser/common/element_handle.go:1915

		"error:notelement":             "node is not an element",
		"error:nothtmlelement":         "not an HTMLElement",
		"error:notfillableelement":     "element is not an <input>, <textarea> or [contenteditable] element",
		"error:notfillableinputtype":   "input of this type cannot be filled",
		"error:notfillablenumberinput": "cannot type text into input[type=number]",
		"error:notvaliddate":           "malformed value",
		"error:notinput":               "node is not an HTMLInputElement",
		"error:notfile":                "node is not an input[type=file] element",
		"error:hasnovalue":             "node is not an HTMLInputElement or HTMLTextAreaElement or HTMLSelectElement",
		"error:notselect":              "element is not a <select> element",
		"error:notcheckbox":            "not a checkbox or radio button",
		"error:notmultiplefileinput":   "non-multiple file input can only accept single file",
		"error:strictmodeviolation":    "strict mode violation, multiple elements returned for selector query",
		"error:notqueryablenode":       "node is not queryable",
		"error:nthnocapture":           "can't query n-th element in a chained selector with capture",
		"error:intercept":              "another element is intercepting with pointer action",
	}
	if err, ok := errs[serr]; ok {
		return errors.New(err)
	}

	return errors.New(serr)
}

View on GitHub (pinned to 01ffac6f24)

Solutions

  1. Wait for the intercepting overlay to disappear: page.waitForSelector('.overlay', {state:'hidden'}) or waitForLoadState before retrying the click
  2. Dismiss the interceptor first (click the banner close button, accept cookies)
  3. Pass {force: true} in the action options to skip actionability checks when the interception is benign
  4. Increase the action timeout so built-in retries can outlast a transient overlay
  5. Scroll the element fully into view or pick a click position away from the overlap

Example fix

// before
await page.click('#submit');

// after
await page.waitForSelector('.loading-overlay', { state: 'hidden' });
await page.click('#submit');
Defensive patterns

Strategy: retry

Validate before calling

// Ensure the click target is the topmost element first
await page.waitForSelector('.overlay', { state: 'hidden' });
await page.click('#submit');

Try / catch

async function safeClick(page, sel) {
  for (let i = 0; i < 3; i++) {
    try { return await page.click(sel); }
    catch (e) {
      if (!/intercepting/.test(e.message)) throw e;
      await page.waitForTimeout(500);
    }
  }
  return page.click(sel, { force: true }); // last resort
}

Prevention

When it happens

Trigger: page.click('#submit') while a loading overlay, cookie banner, or modal backdrop covers the element; a fixed/sticky header overlapping the target after scrolling; the element animating or moving so the click point lands on a neighbor.

Common situations: SPAs with global spinners that fade slowly; anti-bot or consent overlays; clicking immediately after goto before the layout settles; elements in sticky containers on small viewports.

Related errors


AI-assisted analysis of grafana/k6@01ffac6f24 (2026-08-18). Data as JSON: /api/errors/0422a1f876a58d69. Report an issue: GitHub.