{"record":{"id":"90778c76b0162c77","repo":"karatelabs/karate","slug":"configure-driver-stop-false-bypassing-driver-pool-browser","errorCode":null,"errorMessage":"configure driver = {{ stop: false }} — bypassing driver pool; browser will be left running on scenario exit (debug use only)","messagePattern":"configure driver = (.+?)\\} — bypassing driver pool; browser will be left running on scenario exit \\(debug use only\\)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"karate-core/src/main/java/io/karatelabs/core/ScenarioRuntime.java","lineNumber":2179,"sourceCode":"        io.karatelabs.driver.DriverProvider provider = null;\n        if (featureRuntime != null && featureRuntime.getSuite() != null) {\n            provider = featureRuntime.getSuite().getDriverProvider();\n            // Default userDataDir to <buildDir>/karate-temp/chrome-<uuid> if not explicitly set\n            // Uses buildDir (target or build) as sibling to karate-reports, not inside it\n            if (!configMap.containsKey(\"userDataDir\")) {\n                java.nio.file.Path tempDir = java.nio.file.Path.of(\n                        io.karatelabs.common.FileUtils.getBuildDir(),\n                        \"karate-temp\",\n                        \"chrome-\" + java.util.UUID.randomUUID().toString().substring(0, 8));\n                configMap.put(\"userDataDir\", tempDir.toAbsolutePath().toString());\n            }\n        }\n\n        // stop:false is a debug-only flag — bypass the driver pool so the instance\n        // we hand out isn't recycled or auto-closed by the pool's lifecycle.\n        boolean stopFlag = !Boolean.FALSE.equals(configMap.get(\"stop\"));\n        if (!stopFlag && provider != null) {\n            logger.warn(\"configure driver = {{ stop: false }} — bypassing driver pool;\"\n                    + \" browser will be left running on scenario exit (debug use only)\");\n            provider = null;\n        }\n\n        // Determine driver type and parse scope\n        String driverType = (String) configMap.getOrDefault(\"type\", \"chrome\");\n        boolean isW3c = io.karatelabs.driver.w3c.W3cBrowserType.isW3cType(driverType);\n\n        if (isW3c) {\n            io.karatelabs.driver.w3c.W3cDriverOptions w3cOptions = io.karatelabs.driver.w3c.W3cDriverOptions.fromMap(configMap);\n            this.driverScope = w3cOptions.getScope();\n        } else {\n            CdpDriverOptions cdpOptions = CdpDriverOptions.fromMap(configMap);\n            this.driverScope = cdpOptions.getScope();\n        }\n\n        Driver driver;\n        if (provider != null) {","sourceCodeStart":2161,"sourceCodeEnd":2197,"githubUrl":"https://github.com/karatelabs/karate/blob/a22eb90246d958d15a47bf436693d0121ad2812d/karate-core/src/main/java/io/karatelabs/core/ScenarioRuntime.java#L2161-L2197","documentation":"This warning fires when a user configures `configure driver = { ... stop: false }`. Because stop:false is a debug-only flag, Karate bypasses the driver pool entirely (`provider = null`) so the browser instance is not recycled or auto-closed on scenario exit. The browser will keep running after the scenario finishes.","triggerScenarios":"`configure driver = { type: 'chrome', stop: false }` (or equivalent) in a feature, Background, or karate-config; scenario-scoped driver with the stop flag set to false and a pool provider present.","commonSituations":"Debugging DOM state after a failed step; copying a debug config into committed features; leaving `stop:false` set after a debugging session.","solutions":["Remove `stop: false` from the driver config for normal runs","Keep stop:false only in a scratch/debug feature not committed","Re-enable pooling by ensuring the config map has no `stop:false` (or `stop: true`)"],"exampleFix":"// before\nconfigure driver = { type: 'chrome', stop: false }\n// after\nconfigure driver = { type: 'chrome' }","handlingStrategy":"validation","validationCode":"// In karate-config.js, keep stop:false out of shared configs:\nvar cfg = { type: 'chrome' }; // never set stop:false in committed config","typeGuard":"function isDebugDriverConfig(map) { return map != null && Boolean.FALSE.equals(map.get('stop')); }","tryCatchPattern":null,"preventionTips":["Only use stop:false in scratch debug features","Review driver config diffs before committing","Kill leftover browsers after debug runs"],"tags":["karate","driver","configuration","debug"],"backgroundTag":"invalid-config-value","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"}