Class CdpLauncher

java.lang.Object
io.karatelabs.driver.cdp.CdpLauncher

public class CdpLauncher extends Object
CDP-based browser launcher. Manages Chrome browser process lifecycle. Launches Chrome with CDP debugging enabled and provides WebSocket URL for connection.
  • Field Details

  • Method Details

    • closeAll

      public static void closeAll()
      Close all active browser instances.
    • start

      public static CdpLauncher start(CdpDriverOptions options)
      Launch Chrome browser and return launcher instance.
    • getWebSocketUrl

      public static String getWebSocketUrl(String host, int port)
      Get WebSocket URL from existing browser at host:port.
    • getWebSocketUrl

      public String getWebSocketUrl()
    • getPort

      public int getPort()
    • getHost

      public String getHost()
    • isRunning

      public boolean isRunning()
    • close

      public void close()
      Close the browser process. Thread-safe: only the first caller will actually close the process.
    • closeAndWait

      public void closeAndWait()
      Close the browser process and wait for it to terminate. Thread-safe: only the first caller will actually close the process.
    • isClosed

      public boolean isClosed()
      Check if this launcher has been closed.