karatelabs/karate · warning

isResponsive check failed

Error message

isResponsive check failed: {}

What it means

isResponsive() sends a Runtime.evaluate (with awaitPromise, 3s timeout) to probe whether the page's JS event loop answers. On any exception (timeout, dead websocket, crashed renderer) it logs this warning and returns false. A false return means the target could not be proven responsive — callers treat this as an unresponsive page/driver.

Solutions

  1. Investigate what blocks the page main thread (long tasks, alert/confirm dialogs, busy loops) in page code you control.
  2. If the renderer crashed, re-launch the driver/quit and restart the browser.
  3. Increase probes' tolerance in your own watchdog logic, or treat false as a signal to restart the session.
  4. Check CI memory limits — renderer OOM is a common cause.

Example fix

// before
if (!driver.isResponsive()) { throw new RuntimeException("dead"); }
// after
if (!driver.isResponsive()) {
    logger.warn("page unresponsive, restarting driver");
    driver.quit();
    driver = Driver.start(options);
}
Defensive patterns

Strategy: try-catch

Validate before calling

// probe before expensive steps
if (!driver.isResponsive()) { driver.quit(); driver = Driver.start(options); }

Try / catch

if (!driver.isResponsive()) {
    logger.warn("browser unresponsive, restarting");
    driver.quit();
    driver = Driver.start(options);
}

Prevention

When it happens

Trigger: Page JS blocked by a long-running synchronous task or infinite loop; renderer process crashed; CDP connection dropped; evaluate exceeding the 3s timeout.

Common situations: Pages running heavy synchronous computation, dialogs blocking the main thread, renderer OOM/crash on large pages, or the browser being killed externally while the driver still holds the session.

Related errors


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

Appendix: source

Thrown at karate-core/src/main/java/io/karatelabs/driver/cdp/CdpDriver.java:2871

     * probe Runtime.evaluate rather than Page.navigate because it's cheap and local
     * (no network).
     * </p>
     */
    @Override
    public boolean isResponsive() {
        if (terminated || !cdp.isOpen()) {
            return false;
        }
        try {
            CdpResponse response = cdp.method("Runtime.evaluate")
                    .param("expression", "new Promise(function(r){ setTimeout(function(){ r(true); }, 0); })")
                    .param("awaitPromise", true)
                    .param("returnByValue", true)
                    .timeout(Duration.ofSeconds(3))
                    .send();
            return !response.isError() && Boolean.TRUE.equals(response.getResult("result.value"));
        } catch (Exception e) {
            logger.warn("isResponsive check failed: {}", e.getMessage());
            return false;
        }
    }

    // ========== Accessors ==========

    public CdpClient getCdpClient() {
        return cdp;
    }

    @Override
    public DriverOptions getOptions() {
        return options;
    }

    /**
     * Get the CDP-specific options.
     */

View on GitHub (pinned to a22eb90246)