karatelabs/karate · warning

configured executable not found

Error message

configured executable not found: {}

What it means

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.

Solutions

  1. Verify the configured path exists and is executable: run `ls -l <path>` or `test -x <path>`.
  2. On Unix, `chmod +x <path>` if the file exists but lacks the execute bit.
  3. Remove the explicit config to let Karate auto-detect the default Chrome installation.
  4. Use an environment-specific config value so paths match each OS/CI runner.

Example fix

// before (karate-config.js)
karate.configure('driver', { type: 'chrome', executable: '/opt/google/chrome/chrome' });
// after
karate.configure('driver', { type: 'chrome', executable: java.lang.System.getenv('CHROME_BIN') || undefined });
// or drop 'executable' entirely to use the auto-detected default path
Defensive patterns

Strategy: validation

Validate before calling

// before configuring, verify the executable
String bin = System.getenv("CHROME_BIN");
if (bin != null && !java.nio.file.Path.of(bin).toFile().canExecute()) {
    throw new IllegalStateException("configured chrome executable not executable: " + bin);
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Understand the failure class

Background: "File not found" and ENOENT errors: why libraries can't find a file that should exist — this error's family across 50 libraries.

Related errors


AI-assisted analysis of karatelabs/karate@a22eb90246 (2026-09-12). Data as JSON: /api/errors/8e43b61a96458f4a. Report an issue: GitHub.

Appendix: source

Thrown at karate-core/src/main/java/io/karatelabs/driver/cdp/CdpLauncher.java:147

    /**
     * Get WebSocket URL from existing browser at host:port.
     */
    public static String getWebSocketUrl(String host, int port) {
        if (host == null || host.isEmpty()) {
            host = "localhost";
        }
        if (port <= 0 || port > 65535) {
            throw new IllegalArgumentException("port must be between 1 and 65535");
        }
        return fetchWebSocketUrl(host, port);
    }

    private static String resolveExecutable(String configured) {
        if (configured != null && !configured.isEmpty()) {
            if (Files.isExecutable(Path.of(configured))) {
                return configured;
            }
            logger.warn("configured executable not found: {}", configured);
        }

        String defaultPath = getDefaultPath();
        if (defaultPath != null && Files.isExecutable(Path.of(defaultPath))) {
            logger.debug("using default chrome path: {}", defaultPath);
            return defaultPath;
        }

        throw new RuntimeException("chrome executable not found. " +
                "Set 'executable' option, KARATE_CHROME_EXECUTABLE env var, " +
                "or install Chrome at: " + defaultPath);
    }

    private static String getDefaultPath() {
        if (OsUtils.isMac()) {
            return DEFAULT_PATH_MAC;
        } else if (OsUtils.isWindows()) {
            // Prefer 64-bit, fall back to 32-bit

View on GitHub (pinned to a22eb90246)