Class W3cDriverOptions

java.lang.Object
io.karatelabs.driver.w3c.W3cDriverOptions
All Implemented Interfaces:
DriverOptions

public class W3cDriverOptions extends Object implements DriverOptions
W3C WebDriver configuration options. Supports both programmatic construction and config map from Gherkin.

Compatible with v1 configuration keys: webDriverUrl, webDriverSession, capabilities, start, executable, port, addOptions.

  • Method Details

    • fromMap

      public static W3cDriverOptions fromMap(Map<String,Object> map)
      Create options from a config map (from configure driver = {...}).
    • buildSessionPayload

      public Map<String,Object> buildSessionPayload()
      Build the W3C session creation payload. Compatible with v1: supports webDriverSession for full override, capabilities for merge, and auto-generates minimal caps from browser type.
    • getTimeout

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

      public void setTimeout(int millis)
      Description copied from interface: DriverOptions
      Update the operation timeout in milliseconds. Used by Driver.timeout(int) for v1 parity (mid-scenario timeout tweaks).
      Specified by:
      setTimeout in interface DriverOptions
    • getTimeoutDuration

      public Duration getTimeoutDuration()
      Description copied from interface: DriverOptions
      Get timeout as Duration.
      Specified by:
      getTimeoutDuration 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()
      Description copied from interface: DriverOptions
      Check if running in headless mode.
      Specified by:
      isHeadless in interface DriverOptions
    • 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
    • getBrowserType

      public W3cBrowserType getBrowserType()
    • getWebDriverUrl

      public String getWebDriverUrl()
    • isStart

      public boolean isStart()
    • getExecutable

      public String getExecutable()
    • getPort

      public int getPort()
    • getAddOptions

      public List<String> getAddOptions()
    • getScope

      public String getScope()
    • isStop

      public boolean isStop()
      Description copied from interface: DriverOptions
      Whether the browser should be quit at scenario end. Default true. When false, the driver process and browser are intentionally left alive so the DOM can be inspected after the run — typically used for one-off UI debugging. v1 parity: configure driver = { ..., stop: false }.
      Specified by:
      isStop in interface DriverOptions
    • isRemote

      public boolean isRemote()
      Check if this is a remote connection (webDriverUrl set or start=false).