{"record":{"id":"8e43b61a96458f4a","repo":"karatelabs/karate","slug":"configured-executable-not-found","errorCode":null,"errorMessage":"configured executable not found: {}","messagePattern":"configured executable not found: (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"karate-core/src/main/java/io/karatelabs/driver/cdp/CdpLauncher.java","lineNumber":147,"sourceCode":"    /**\n     * Get WebSocket URL from existing browser at host:port.\n     */\n    public static String getWebSocketUrl(String host, int port) {\n        if (host == null || host.isEmpty()) {\n            host = \"localhost\";\n        }\n        if (port <= 0 || port > 65535) {\n            throw new IllegalArgumentException(\"port must be between 1 and 65535\");\n        }\n        return fetchWebSocketUrl(host, port);\n    }\n\n    private static String resolveExecutable(String configured) {\n        if (configured != null && !configured.isEmpty()) {\n            if (Files.isExecutable(Path.of(configured))) {\n                return configured;\n            }\n            logger.warn(\"configured executable not found: {}\", configured);\n        }\n\n        String defaultPath = getDefaultPath();\n        if (defaultPath != null && Files.isExecutable(Path.of(defaultPath))) {\n            logger.debug(\"using default chrome path: {}\", defaultPath);\n            return defaultPath;\n        }\n\n        throw new RuntimeException(\"chrome executable not found. \" +\n                \"Set 'executable' option, KARATE_CHROME_EXECUTABLE env var, \" +\n                \"or install Chrome at: \" + defaultPath);\n    }\n\n    private static String getDefaultPath() {\n        if (OsUtils.isMac()) {\n            return DEFAULT_PATH_MAC;\n        } else if (OsUtils.isWindows()) {\n            // Prefer 64-bit, fall back to 32-bit","sourceCodeStart":129,"sourceCodeEnd":165,"githubUrl":"https://github.com/karatelabs/karate/blob/a22eb90246d958d15a47bf436693d0121ad2812d/karate-core/src/main/java/io/karatelabs/driver/cdp/CdpLauncher.java#L129-L165","documentation":"WARN log from CdpLauncher.resolveExecutable when a browser path was explicitly configured but the file either does not exist or is not executable. Karate logs the miss and falls back to its default Chrome lookup (getDefaultPath()), so startup may still succeed with the auto-detected browser.","triggerScenarios":"Setting the driver executable config (e.g. karateOptions/Config 'executable' or chromeBinary-like config) to a path that doesn't exist, is a relative path resolved from the wrong working directory, or lacks the executable bit.","commonSituations":"Hardcoded macOS/Windows paths checked into config on a different OS; Chrome installed under a versioned path (/opt/google/chrome/chrome-120/...) that changed after an upgrade; downloaded binary without chmod +x; typo in the configured path.","solutions":["Verify the configured path exists and is executable: run `ls -l <path>` or `test -x <path>`.","On Unix, `chmod +x <path>` if the file exists but lacks the execute bit.","Remove the explicit config to let Karate auto-detect the default Chrome installation.","Use an environment-specific config value so paths match each OS/CI runner."],"exampleFix":"// before (karate-config.js)\nkarate.configure('driver', { type: 'chrome', executable: '/opt/google/chrome/chrome' });\n// after\nkarate.configure('driver', { type: 'chrome', executable: java.lang.System.getenv('CHROME_BIN') || undefined });\n// or drop 'executable' entirely to use the auto-detected default path","handlingStrategy":"validation","validationCode":"// before configuring, verify the executable\nString bin = System.getenv(\"CHROME_BIN\");\nif (bin != null && !java.nio.file.Path.of(bin).toFile().canExecute()) {\n    throw new IllegalStateException(\"configured chrome executable not executable: \" + bin);\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Resolve browser paths from environment variables instead of hardcoding per-OS paths.","Run `test -x <path>` / check canExecute() in CI setup before the suite.","Prefer letting Karate auto-detect the default Chrome when no special binary is needed.","chmod +x any downloaded browser binaries in setup scripts."],"tags":["chrome","executable","configuration","fallback"],"backgroundTag":"file-not-found","analyzedSha":"a22eb90246d958d15a47bf436693d0121ad2812d","analyzedAt":"2026-09-12T09:01:00.220Z","contentChangedAt":"2026-09-12T09:01:00.220Z","schemaVersion":2},"datasetVersion":"2026-09-19T12:17:13.211Z"}