{"record":{"id":"7ecbd806a5c88616","repo":"grafana/k6","slug":"describing-dom-node-w","errorCode":null,"errorMessage":"describing DOM node: %w","messagePattern":"describing DOM node: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/js/modules/k6/browser/common/execution_context.go","lineNumber":149,"sourceCode":"\te.logger.Debugf(\n\t\t\"ExecutionContext:adoptElementHandle\",\n\t\t\"sid:%s stid:%s fid:%s ectxid:%d furl:%q ehtid:%s ehsid:%s\",\n\t\te.sid, e.stid, e.fid, e.id, e.furl,\n\t\tefid, esid)\n\n\tif eh.execCtx == e {\n\t\treturn nil, errors.New(\"already belongs to the same execution context\")\n\t}\n\tif e.frame == nil {\n\t\treturn nil, errors.New(\"does not have a frame owner\")\n\t}\n\n\tvar node *cdp.Node\n\tvar err error\n\n\taction := dom.DescribeNode().WithObjectID(eh.remoteObject.ObjectID)\n\tif node, err = action.Do(cdp.WithExecutor(e.ctx, e.session)); err != nil {\n\t\treturn nil, fmt.Errorf(\"describing DOM node: %w\", err)\n\t}\n\n\treturn e.adoptBackendNodeID(node.BackendNodeID)\n}\n\n// eval evaluates the provided JavaScript within this execution context and\n// returns a value or handle.\n//\n//nolint:funlen\nfunc (e *ExecutionContext) eval(\n\tapiCtx context.Context, opts evalOptions, js string, args ...any,\n) (any, error) {\n\tif escapesSobekValues(args...) {\n\t\treturn nil, errors.New(\"sobek.Value escaped\")\n\t}\n\te.logger.Debugf(\n\t\t\"ExecutionContext:eval\",\n\t\t\"sid:%s stid:%s fid:%s ectxid:%d furl:%q %s\",","sourceCodeStart":131,"sourceCodeEnd":167,"githubUrl":"https://github.com/grafana/k6/blob/01ffac6f245854c1b8adc6a69857c76a15f90022/internal/js/modules/k6/browser/common/execution_context.go#L131-L167","documentation":"Returned by ExecutionContext.adoptElementHandle when the CDP dom.DescribeNode call (getting node metadata for the handle being adopted into this context) fails. Wraps the CDP error; usually the handle's remote object became invalid (navigation/detach) or the session errored.","triggerScenarios":"Thrown at internal/js/modules/k6/browser/common/execution_context.go:149 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Retry adoption once the frame is stable","Re-create the element handle in its own frame before adopting","Check wrapped error for closed-target or session errors"],"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"}