{"record":{"id":"38577938b60d8a2c","repo":"grafana/k6","slug":"resolving-dom-node-w","errorCode":null,"errorMessage":"resolving DOM node: %w","messagePattern":"resolving DOM node: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/js/modules/k6/browser/common/execution_context.go","lineNumber":105,"sourceCode":"\n// Adopts specified backend node into this execution context from another execution context.\nfunc (e *ExecutionContext) adoptBackendNodeID(backendNodeID cdp.BackendNodeID) (*ElementHandle, error) {\n\te.logger.Debugf(\n\t\t\"ExecutionContext:adoptBackendNodeID\",\n\t\t\"sid:%s stid:%s fid:%s ectxid:%d furl:%q bnid:%d\",\n\t\te.sid, e.stid, e.fid, e.id, e.furl, backendNodeID)\n\n\tvar (\n\t\tremoteObj *runtime.RemoteObject\n\t\terr       error\n\t)\n\n\taction := dom.ResolveNode().\n\t\tWithBackendNodeID(backendNodeID).\n\t\tWithExecutionContextID(e.id)\n\n\tif remoteObj, err = action.Do(cdp.WithExecutor(e.ctx, e.session)); err != nil {\n\t\treturn nil, fmt.Errorf(\"resolving DOM node: %w\", err)\n\t}\n\n\t// This can occur due to race conditions between trying to click on an element\n\t// and chrome moving on (e.g. navigating).\n\tif remoteObj == nil {\n\t\treturn nil, fmt.Errorf(`the page may have navigated away or the element is\n\t\t\tnow missing. It might happen when k6 and/or Chrome are overloaded. You\n\t\t\tmight need to increase the compute resources`)\n\t}\n\n\treturn NewJSHandle(e.ctx, e.session, e, e.frame, remoteObj, e.logger).AsElement(), nil\n}\n\n// Adopts the specified element handle into this execution context from another execution context.\nfunc (e *ExecutionContext) adoptElementHandle(eh *ElementHandle) (*ElementHandle, error) {\n\tvar (\n\t\tefid cdp.FrameID\n\t\tesid target.SessionID","sourceCodeStart":87,"sourceCodeEnd":123,"githubUrl":"https://github.com/grafana/k6/blob/01ffac6f245854c1b8adc6a69857c76a15f90022/internal/js/modules/k6/browser/common/execution_context.go#L87-L123","documentation":"Returned by ExecutionContext.adoptBackendNodeID when the CDP dom.ResolveNode call (adopting a backend node into this execution context) fails. Wraps the CDP error; common causes are the node no longer existing, cross-origin frame restrictions, or the context being destroyed by navigation.","triggerScenarios":"Thrown at internal/js/modules/k6/browser/common/execution_context.go:105 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Retry the adoption after navigation settles","Ensure the element still exists in the DOM","Check for cross-process iframe restrictions if adopting across frames"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"01ffac6f245854c1b8adc6a69857c76a15f90022","analyzedAt":"2026-08-18T03:05:52.393Z","contentChangedAt":"2026-08-18T03:05:52.393Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}