{"record":{"id":"44c218fad361c18a","repo":"grafana/k6","slug":"calling-function-w","errorCode":null,"errorMessage":"calling function: %w","messagePattern":"calling function: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/js/modules/k6/browser/common/frame.go","lineNumber":2377,"sourceCode":"\t// id returns the CDP runtime ID of this execution context.\n\tID() runtime.ExecutionContextID\n}\n\nfunc (f *Frame) runActionOnSelector(\n\tctx context.Context, selector string, strict bool, fn elementHandleActionFunc, nullResponder func() bool,\n) (bool, error) {\n\thandle, err := f.Query(selector, strict)\n\tif err != nil {\n\t\treturn false, fmt.Errorf(\"query: %w\", err)\n\t}\n\tif handle == nil {\n\t\tf.log.Debugf(\"Frame:runActionOnSelector:nilHandler\", \"fid:%s furl:%q selector:%s\", f.ID(), f.URL(), selector)\n\t\treturn nullResponder(), err\n\t}\n\n\tv, err := fn(ctx, handle)\n\tif err != nil {\n\t\treturn false, fmt.Errorf(\"calling function: %w\", err)\n\t}\n\n\tbv, ok := v.(bool)\n\tif !ok {\n\t\treturn false, fmt.Errorf(\"unexpected type %T\", v)\n\t}\n\n\treturn bv, nil\n}\n\n//nolint:unparam\nfunc (f *Frame) newAction(\n\tselector string, state DOMElementState, strict bool, fn elementHandleActionFunc, states []string,\n\tforce bool, retry bool, noWaitAfter bool, timeout time.Duration,\n) func(apiCtx context.Context, resultCh chan any, errCh chan error) {\n\t// We execute a frame action in the following steps:\n\t// 1. Find element matching specified selector\n\t// 2. Wait for it to reach specified DOM state","sourceCodeStart":2359,"sourceCodeEnd":2395,"githubUrl":"https://github.com/grafana/k6/blob/3fcf5388d78cb382f0c0d42ec556a06bfd1b8dee/internal/js/modules/k6/browser/common/frame.go#L2359-L2395","documentation":"Returned by Frame.runActionOnSelector when invoking the element-handle action function (the actual state read or operation) fails after the element was successfully resolved. The wrapped error is the action's own failure: evaluation error, timeout, or CDP cause.","triggerScenarios":"Thrown at internal/js/modules/k6/browser/common/frame.go:2369 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Inspect the wrapped action error for the root cause","Retry after the DOM/frame stabilizes","Increase the relevant timeout"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"3fcf5388d78cb382f0c0d42ec556a06bfd1b8dee","analyzedAt":"2026-08-18T03:05:52.393Z","contentChangedAt":"2026-08-18T03:05:52.393Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}