{"record":{"id":"12449f7769eceb9a","repo":"karatelabs/karate","slug":"page-navigate-returned-err-aborted-retrying","errorCode":null,"errorMessage":"Page.navigate returned ERR_ABORTED, retrying ({}/{}): {}","messagePattern":"Page\\.navigate returned ERR_ABORTED, retrying \\((.+?)/(.+?)\\): (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"karate-core/src/main/java/io/karatelabs/driver/cdp/CdpDriver.java","lineNumber":1313,"sourceCode":"            try {\n                navResponse = cdp.method(\"Page.navigate\")\n                        .param(\"url\", url)\n                        .send();\n            } catch (RuntimeException e) {\n                boolean transientNavTimeout = e.getMessage() != null\n                        && e.getMessage().contains(\"CDP timeout for: Page.navigate\");\n                if (transientNavTimeout && attempt < navAttempts - 1) {\n                    logger.warn(\"Page.navigate timed out, retrying ({}/{}): {}\", attempt + 1, navAttempts - 1, url);\n                    continue;\n                }\n                throw e;\n            }\n            aborted = \"net::ERR_ABORTED\".equals(navResponse.getResultAsString(\"errorText\"));\n            if (!aborted) {\n                break; // committed, an error page under the same loader, or a normal response\n            }\n            if (attempt < navAttempts - 1) {\n                logger.warn(\"Page.navigate returned ERR_ABORTED, retrying ({}/{}): {}\", attempt + 1, navAttempts - 1, url);\n                sleep(150); // let an in-flight/racing navigation (e.g. pooled-reset about:blank) settle\n            }\n        }\n\n        // Every attempt aborted — a deliberate download / 204-205 / window.stop() that\n        // retains the current document. The returned loader never commits, never fires\n        // DOMContentLoaded, and a loader-bound wait for it could only end in a timeout,\n        // so return with the page as-is (genuine load failures instead commit an error\n        // page under the SAME loader, and the normal wait below handles those).\n        if (aborted) {\n            logger.warn(\"navigation aborted by browser, current document retained: {}\", url);\n            pendingNavigationUrl = null;\n            return;\n        }\n\n        // data: and about: URLs commit locally and don't fire the normal load lifecycle,\n        // so the full waitForPageLoad below would only ever time out on them. Returning\n        // with no barrier at all is what let the pooled reset's about:blank still be in","sourceCodeStart":1295,"sourceCodeEnd":1331,"githubUrl":"https://github.com/karatelabs/karate/blob/a22eb90246d958d15a47bf436693d0121ad2812d/karate-core/src/main/java/io/karatelabs/driver/cdp/CdpDriver.java#L1295-L1331","documentation":"When the browser responds to Page.navigate with errorText 'net::ERR_ABORTED', the CDP driver logs this warning and sleeps 150ms before retrying, letting an in-flight or racing navigation (e.g. a pooled-reset about:blank) settle. ERR_ABORTED means the navigation was cancelled by the browser rather than committed. If every attempt is aborted, the driver instead treats it as a deliberate download/204/window.stop and keeps the current document.","triggerScenarios":"driver.get()/loadUrl() where navResponse.getResultAsString(\"errorText\") equals 'net::ERR_ABORTED' and attempt < navAttempts - 1.","commonSituations":"Navigating to URLs that trigger a download instead of a document, HTTP 204/205 responses, in-page window.stop(), or a race where the driver resets the page to about:blank (pooled drivers) while the navigation starts.","solutions":["Expect the abort: for download/204 targets use driver.download or HTTP steps instead of driver.get().","Retry the navigation after a short delay; the 150ms settle often resolves the race.","Check for pooled-driver about:blank resets colliding with your navigation (serialize driver usage per scenario).","Inspect the page for window.stop() calls or meta refresh/JS that immediately cancels navigation."],"exampleFix":"// before\ndriver.get('https://example.com/report.csv'); // triggers download, ERR_ABORTED\n// after\ndriver.http('https://example.com/report.csv').download(); // or use karate HTTP for non-document responses","handlingStrategy":"retry","validationCode":"// detect download/204 targets before driver.get()\nvar head = karate.http(url).method('head'); boolean isDocument = head.status < 300 && !head.header('content-disposition');","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use HTTP/download steps for non-document URLs","Avoid window.stop() in pages under test","Serialize pooled-driver usage to avoid about:blank reset races","Retry navigations once after a short settle delay"],"tags":["cdp","navigation","err-aborted","retry"],"backgroundTag":"navigation-aborted","analyzedSha":"a22eb90246d958d15a47bf436693d0121ad2812d","analyzedAt":"2026-09-12T09:01:00.220Z","contentChangedAt":"2026-09-12T09:01:00.220Z","schemaVersion":2},"datasetVersion":"2026-09-16T19:17:19.609Z"}