{"record":{"id":"af8c4d60eabaec59","repo":"grafana/k6","slug":"waiting-for-navigation-w","errorCode":null,"errorMessage":"waiting for navigation: %w","messagePattern":"waiting for navigation: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/js/modules/k6/browser/common/element_handle.go","lineNumber":1784,"sourceCode":"\t\t\t\treturn nil, fmt.Errorf(\"checking hit target: %w\", err)\n\t\t\t}\n\t\t}\n\t\t// Are we only \"trialing\" the action but not actually performing\n\t\t// it (ie. running the actionability checks).\n\t\tif opts.Trial {\n\t\t\treturn nil, nil //nolint:nilnil\n\t\t}\n\n\t\tb := NewBarrier()\n\t\th.frame.manager.addBarrier(b)\n\t\tdefer h.frame.manager.removeBarrier(b)\n\t\tif res, err = fn(apiCtx, h, p); err != nil {\n\t\t\treturn nil, fmt.Errorf(\"evaluating pointer action: %w\", err)\n\t\t}\n\t\t// Do we need to wait for navigation to happen\n\t\tif !opts.NoWaitAfter {\n\t\t\tif err = b.Wait(apiCtx); err != nil {\n\t\t\t\treturn nil, fmt.Errorf(\"waiting for navigation: %w\", err)\n\t\t\t}\n\t\t}\n\n\t\treturn res, nil\n\t}\n\n\treturn func(apiCtx context.Context, resultCh chan any, errCh chan error) {\n\t\tif res, err := retryPointerAction(apiCtx, pointerFn, opts); err != nil {\n\t\t\tselect {\n\t\t\tcase <-apiCtx.Done():\n\t\t\tcase errCh <- err:\n\t\t\t}\n\t\t} else {\n\t\t\tselect {\n\t\t\tcase <-apiCtx.Done():\n\t\t\tcase resultCh <- res:\n\t\t\t}\n\t\t}","sourceCodeStart":1766,"sourceCodeEnd":1802,"githubUrl":"https://github.com/grafana/k6/blob/3fcf5388d78cb382f0c0d42ec556a06bfd1b8dee/internal/js/modules/k6/browser/common/element_handle.go#L1766-L1802","documentation":"Returned in the pointer-action pipeline when, after the action executed, the code waits on an installed barrier for induced navigation/events (unless NoWaitAfter) and the barrier's Wait fails — typically the action context timing out or being cancelled while waiting for post-action navigation to settle.","triggerScenarios":"Thrown at internal/js/modules/k6/browser/common/element_handle.go:1780 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Increase the action timeout to cover post-action navigation","Pass noWaitAfter:true if no navigation is expected and the wait is unnecessary","Ensure the target page responds to the action without long redirects"],"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"}