Class CdpDriverOptions

java.lang.Object
io.karatelabs.driver.cdp.CdpDriverOptions
All Implemented Interfaces:
DriverOptions

public class CdpDriverOptions extends Object implements DriverOptions
CDP-specific driver configuration options. Implements DriverOptions interface and adds CDP-specific settings. Supports both Builder pattern and Map constructor for v1 compatibility.
  • Method Details

    • builder

      public static CdpDriverOptions.Builder builder()
    • fromMap

      public static CdpDriverOptions fromMap(Map<String,Object> map)
    • getTimeout

      public int getTimeout()
      Description copied from interface: DriverOptions
      Get timeout in milliseconds.
      Specified by:
      getTimeout in interface DriverOptions
    • getRetryCount

      public int getRetryCount()
      Description copied from interface: DriverOptions
      Get retry count for operations.
      Specified by:
      getRetryCount in interface DriverOptions
    • getRetryInterval

      public int getRetryInterval()
      Description copied from interface: DriverOptions
      Get retry interval in milliseconds.
      Specified by:
      getRetryInterval in interface DriverOptions
    • isHeadless

      public boolean isHeadless()
      Check headless mode. Falls back to KARATE_DRIVER_HEADLESS env var if not set explicitly.
      Specified by:
      isHeadless in interface DriverOptions
    • getHost

      public String getHost()
    • getPort

      public int getPort()
    • getExecutable

      public String getExecutable()
      Get executable path. Falls back to KARATE_CHROME_EXECUTABLE env var if not set explicitly.
    • getUserDataDir

      public String getUserDataDir()
    • getUserAgent

      public String getUserAgent()
    • isScreenshotOnFailure

      public boolean isScreenshotOnFailure()
      Description copied from interface: DriverOptions
      Check if screenshots should be taken on failure.
      Specified by:
      isScreenshotOnFailure in interface DriverOptions
    • isHighlight

      public boolean isHighlight()
      Description copied from interface: DriverOptions
      Check if element highlighting is enabled.
      Specified by:
      isHighlight in interface DriverOptions
    • getHighlightDuration

      public int getHighlightDuration()
      Description copied from interface: DriverOptions
      Get highlight duration in milliseconds.
      Specified by:
      getHighlightDuration in interface DriverOptions
    • getPageLoadStrategy

      public PageLoadStrategy getPageLoadStrategy()
      Description copied from interface: DriverOptions
      Get page load strategy.
      Specified by:
      getPageLoadStrategy in interface DriverOptions
    • getPreSubmitHash

      public String getPreSubmitHash()
      Description copied from interface: DriverOptions
      Get the pre-submit hash (set by submit(), cleared after next action).
      Specified by:
      getPreSubmitHash in interface DriverOptions
    • setPreSubmitHash

      public void setPreSubmitHash(String hash)
      Description copied from interface: DriverOptions
      Set the pre-submit hash. Called by submit() to record page state before action.
      Specified by:
      setPreSubmitHash in interface DriverOptions
    • getAddOptions

      public List<String> getAddOptions()
      Get additional Chrome args. Merges explicit addOptions with KARATE_CHROME_ARGS env var.
    • getWebSocketUrl

      public String getWebSocketUrl()
    • getScope

      public String getScope()
      Get driver scope (default: "scenario").
      • "scenario" - driver released at scenario end (pooled behavior)
      • "caller" - driver propagates to caller hierarchy (V1 behavior)
    • isCallerScope

      public boolean isCallerScope()
      Check if driver scope is "caller" (V1-style behavior).
    • getTimeoutDuration

      public Duration getTimeoutDuration()
      Description copied from interface: DriverOptions
      Get timeout as Duration.
      Specified by:
      getTimeoutDuration in interface DriverOptions