{"record":{"id":"fdcccff5a53dc454","repo":"grafana/k6","slug":"double-clicking-on-element-w","errorCode":null,"errorMessage":"double clicking on element: %w","messagePattern":"double clicking on element: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/js/modules/k6/browser/common/element_handle.go","lineNumber":880,"sourceCode":"\t\treturn nil, fmt.Errorf(\"element is not an iframe\")\n\t}\n\n\tframe, ok := h.frame.manager.getFrameByID(node.FrameID)\n\tif !ok {\n\t\treturn nil, fmt.Errorf(\"frame not found for id %s\", node.FrameID)\n\t}\n\n\treturn frame, nil\n}\n\n// Dblclick scrolls element into view and double clicks on the element.\nfunc (h *ElementHandle) Dblclick(opts *ElementHandleDblclickOptions) error {\n\tdblclick := func(_ context.Context, handle *ElementHandle, p *Position) (any, error) {\n\t\treturn nil, handle.dblclick(p, opts.ToMouseClickOptions())\n\t}\n\tdblclickAction := h.newPointerAction(dblclick, &opts.ElementHandleBasePointerOptions)\n\tif _, err := call(h.ctx, dblclickAction, opts.Timeout); err != nil {\n\t\treturn fmt.Errorf(\"double clicking on element: %w\", err)\n\t}\n\n\tapplySlowMo(h.ctx)\n\n\treturn nil\n}\n\n// DispatchEvent dispatches a DOM event to the element.\nfunc (h *ElementHandle) DispatchEvent(typ string, eventInit any) error {\n\tdispatchEvent := func(apiCtx context.Context, handle *ElementHandle) (any, error) {\n\t\treturn handle.dispatchEvent(apiCtx, typ, eventInit)\n\t}\n\topts := NewElementHandleBaseOptions(h.DefaultTimeout())\n\tdispatchEventAction := h.newAction(\n\t\t[]string{}, dispatchEvent, opts.Force, withRetry, opts.NoWaitAfter, opts.Timeout,\n\t)\n\tif _, err := call(h.ctx, dispatchEventAction, opts.Timeout); err != nil {\n\t\treturn fmt.Errorf(\"dispatching element event %q: %w\", typ, err)","sourceCodeStart":862,"sourceCodeEnd":898,"githubUrl":"https://github.com/grafana/k6/blob/93accf6570dcd306ca5e99cc44c393ee3797761b/internal/js/modules/k6/browser/common/element_handle.go#L862-L898","documentation":"Top-level wrapper for ElementHandle.Dblclick. It runs the same pointer-action pipeline as Click (scroll into view, visible/stable/enabled waits, hit-target check, double click) under opts.Timeout; any failure surfaces as 'double clicking on element: <cause>'.","triggerScenarios":"handle.dblclick() on an element that never becomes visible/stable/enabled in time, an overlay intercepting the hit target, the element detaching mid-action, or the navigation wait timing out after the double click.","commonSituations":"Double-clicking rows in grids with loading overlays; animations preventing 'stable'; disabled controls; short timeouts in CI; stale handles after list re-renders.","solutions":["Increase the timeout option","Use { force: true } when an overlay is known and benign","Dismiss intercepting overlays first","Re-locate the element immediately before dblclick","Use { noWaitAfter: true } if the post-action navigation wait is the blocker"],"exampleFix":"// before\nawait handle.dblclick({ timeout: 2000 }); // double clicking on element: timeout\n\n// after\nawait page.waitForSelector(sel, { state: 'visible' });\nawait (await page.$(sel)).dblclick({ timeout: 30000 });","handlingStrategy":"retry","validationCode":"const visible = await handle.isVisible();\nconst enabled = await handle.isEnabled();\nif (!visible || !enabled) throw new Error('element not actionable for dblclick');","typeGuard":null,"tryCatchPattern":"try {\n  await handle.dblclick({ timeout: 30000 });\n} catch (e) {\n  const msg = String(e);\n  if (msg.includes('intercepting')) {\n    await (await page.$('.overlay-close')).click();\n    await handle.dblclick({ timeout: 30000 });\n  } else if (msg.includes('timed out')) {\n    await handle.dblclick({ force: true });\n  } else { throw e; }\n}","preventionTips":["Clear grid/list overlays before double-clicking rows","Use generous timeouts in CI","Re-locate rows after list re-renders"],"tags":["browser","dblclick","actionability","timeout","intercept"],"backgroundTag":null,"analyzedSha":"93accf6570dcd306ca5e99cc44c393ee3797761b","analyzedAt":"2026-08-15T21:23:27.118Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}