Package org.openqa.selenium.firefox
Class GeckoDriverService.Builder
java.lang.Object
org.openqa.selenium.remote.service.DriverService.Builder<GeckoDriverService,GeckoDriverService.Builder>
org.openqa.selenium.firefox.FirefoxDriverService.Builder<GeckoDriverService,GeckoDriverService.Builder>
org.openqa.selenium.firefox.GeckoDriverService.Builder
- Enclosing class:
GeckoDriverService
@AutoService(Builder.class)
public static class GeckoDriverService.Builder
extends FirefoxDriverService.Builder<GeckoDriverService,GeckoDriverService.Builder>
Builder used to configure new
GeckoDriverService instances.-
Field Summary
Fields inherited from class org.openqa.selenium.remote.service.DriverService.Builder
exe -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionconnectToExisting(int marionettePort) Configures geckodriver to connect to an existing Firefox instance via the specified Marionette port.protected GeckoDriverServicecreateDriverService(@Nullable File exe, int port, @Nullable Duration timeout, @Nullable List<String> args, @Nullable Map<String, String> environment) protected voidintscore(Capabilities capabilities) Provides a measure of how strongly thisDriverServicesupports the givencapabilities.withAllowHosts(@Nullable String allowHosts) Values of the Host header to allow for incoming requests.withLogLevel(@Nullable FirefoxDriverLogLevel logLevel) withProfileRoot(@Nullable File root) This is necessary when you do not have permissions to write to the default directory.withTruncatedLogs(@Nullable Boolean truncate) withWebSocketPort(@Nullable Integer websocketPort) Configures the WebSocket port for BiDi.Methods inherited from class org.openqa.selenium.remote.service.DriverService.Builder
build, getDefaultTimeout, getLogFile, getLogOutput, getPort, parseLogOutput, usingAnyFreePort, usingDriverExecutable, usingPort, withEnvironment, withLogFile, withLogOutput, withTimeout
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
score
Description copied from class:DriverService.BuilderProvides a measure of how strongly thisDriverServicesupports the givencapabilities. A score of 0 or less indicates that thisDriverServicedoes not support instances ofWebDriverthat requirecapabilities. Typically, the score is generated by summing the number of capabilities that the driver service directly supports that are unique to the driver service (that is, things like "proxy" don't tend to count to the score).- Specified by:
scorein classDriverService.Builder<GeckoDriverService,GeckoDriverService.Builder>
-
withAllowHosts
Values of the Host header to allow for incoming requests.- Parameters:
allowHosts- Space-separated list of host names.- Returns:
- A self reference.
-
withLogLevel
- Parameters:
logLevel- which log events to record.- Returns:
- A self reference.
-
withTruncatedLogs
- 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
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
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
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:
loadSystemPropertiesin classDriverService.Builder<GeckoDriverService,GeckoDriverService.Builder>
-
createArgs
- Specified by:
createArgsin classDriverService.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:
createDriverServicein classDriverService.Builder<GeckoDriverService,GeckoDriverService.Builder>
-