Class GeckoDriverService.Builder

java.lang.Object
org.openqa.selenium.remote.service.DriverService.Builder<GeckoDriverService,GeckoDriverService.Builder>
Enclosing class:
GeckoDriverService

@AutoService(org.openqa.selenium.remote.service.DriverService.Builder.class) public static class GeckoDriverService.Builder extends FirefoxDriverService.Builder<GeckoDriverService,GeckoDriverService.Builder>
Builder used to configure new GeckoDriverService instances.
  • Constructor Details

    • Builder

      public Builder()
  • Method Details

    • score

      public int score(org.openqa.selenium.Capabilities capabilities)
      Specified by:
      score in class org.openqa.selenium.remote.service.DriverService.Builder<GeckoDriverService,GeckoDriverService.Builder>
    • withAllowHosts

      public GeckoDriverService.Builder withAllowHosts(@Nullable String allowHosts)
      Values of the Host header to allow for incoming requests.
      Parameters:
      allowHosts - Space-separated list of host names.
      Returns:
      A self reference.
    • withLogLevel

      public GeckoDriverService.Builder withLogLevel(@Nullable FirefoxDriverLogLevel logLevel)
      Parameters:
      logLevel - which log events to record.
      Returns:
      A self reference.
    • withTruncatedLogs

      public GeckoDriverService.Builder withTruncatedLogs(@Nullable Boolean truncate)
      Parameters:
      truncate - whether to truncate long lines in the log. Log lines are truncated by default; setting "false" removes truncation
      Returns:
      A self reference.
    • withProfileRoot

      public GeckoDriverService.Builder withProfileRoot(@Nullable File root)
      This is necessary when you do not have permissions to write to the default directory.
      Parameters:
      root - location to store temporary profiles Defaults to the system temporary directory.
      Returns:
      A self reference.
    • connectToExisting

      public GeckoDriverService.Builder connectToExisting(int marionettePort)
      Configures geckodriver to connect to an existing Firefox instance via the specified Marionette port.
      Parameters:
      marionettePort - The port where Marionette is listening on the existing Firefox instance.
      Returns:
      A self reference.
    • withWebSocketPort

      public GeckoDriverService.Builder withWebSocketPort(@Nullable Integer websocketPort)
      Configures the WebSocket port for BiDi. A value of 0 will automatically allocate a free port.
      Parameters:
      websocketPort - The port to use for WebSocket communication, or 0 for automatic allocation.
      Returns:
      A self reference.
    • loadSystemProperties

      protected void loadSystemProperties()
      Specified by:
      loadSystemProperties in class org.openqa.selenium.remote.service.DriverService.Builder<GeckoDriverService,GeckoDriverService.Builder>
    • createArgs

      protected List<String> createArgs()
      Specified by:
      createArgs in class org.openqa.selenium.remote.service.DriverService.Builder<GeckoDriverService,GeckoDriverService.Builder>
    • createDriverService

      protected GeckoDriverService createDriverService(@Nullable File exe, int port, @Nullable Duration timeout, @Nullable List<String> args, @Nullable Map<String,String> environment)
      Specified by:
      createDriverService in class org.openqa.selenium.remote.service.DriverService.Builder<GeckoDriverService,GeckoDriverService.Builder>