Package org.openqa.selenium.chrome
Class ChromeDriverService
- java.lang.Object
-
- org.openqa.selenium.remote.service.DriverService
-
- org.openqa.selenium.chrome.ChromeDriverService
-
- All Implemented Interfaces:
java.io.Closeable
,java.lang.AutoCloseable
public class ChromeDriverService extends org.openqa.selenium.remote.service.DriverService
Manages the life and death of a ChromeDriver server.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ChromeDriverService.Builder
Builder used to configure newChromeDriverService
instances.
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
CHROME_DRIVER_ALLOWED_IPS_PROPERTY
System property that defines comma-separated list of remote IPv4 addresses which are allowed to connect to ChromeDriver.static java.lang.String
CHROME_DRIVER_APPEND_LOG_PROPERTY
Boolean system property that defines whether ChromeDriver should append to existing log file.static java.lang.String
CHROME_DRIVER_DISABLE_BUILD_CHECK
System property that defines whether the ChromeDriver executable should check for build version compatibility between ChromeDriver and the browser.static java.lang.String
CHROME_DRIVER_EXE_PROPERTY
System property that defines the location of the ChromeDriver executable that will be used by thedefault service
.static java.lang.String
CHROME_DRIVER_LOG_LEVEL_PROPERTY
System property that defines theChromiumDriverLogLevel
for ChromeDriver logs.static java.lang.String
CHROME_DRIVER_LOG_PROPERTY
System property that defines the location of the file where ChromeDriver should write log messages to.static java.lang.String
CHROME_DRIVER_NAME
static java.lang.String
CHROME_DRIVER_READABLE_TIMESTAMP
System property that toggles the formatting of the timestamps of the logsstatic java.lang.String
CHROME_DRIVER_SILENT_OUTPUT_PROPERTY
Boolean system property that defines whether the ChromeDriver executable should be started in silent mode.static java.lang.String
CHROME_DRIVER_VERBOSE_LOG_PROPERTY
Boolean system property that defines whether the ChromeDriver executable should be started with verbose logging.static java.lang.String
CHROME_DRIVER_WHITELISTED_IPS_PROPERTY
Deprecated.
-
Constructor Summary
Constructors Constructor Description ChromeDriverService(java.io.File executable, int port, java.time.Duration timeout, java.util.List<java.lang.String> args, java.util.Map<java.lang.String,java.lang.String> environment)
ChromeDriverService(java.io.File executable, int port, java.util.List<java.lang.String> args, java.util.Map<java.lang.String,java.lang.String> environment)
Deprecated.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static ChromeDriverService
createDefaultService()
Configures and returns a newChromeDriverService
using the default configuration.static ChromeDriverService
createServiceWithConfig(ChromeOptions options)
Deprecated.org.openqa.selenium.Capabilities
getDefaultDriverOptions()
java.lang.String
getDriverName()
java.lang.String
getDriverProperty()
-
-
-
Field Detail
-
CHROME_DRIVER_NAME
public static final java.lang.String CHROME_DRIVER_NAME
- See Also:
- Constant Field Values
-
CHROME_DRIVER_EXE_PROPERTY
public static final java.lang.String CHROME_DRIVER_EXE_PROPERTY
System property that defines the location of the ChromeDriver executable that will be used by thedefault service
.- See Also:
- Constant Field Values
-
CHROME_DRIVER_READABLE_TIMESTAMP
public static final java.lang.String CHROME_DRIVER_READABLE_TIMESTAMP
System property that toggles the formatting of the timestamps of the logs- See Also:
- Constant Field Values
-
CHROME_DRIVER_LOG_PROPERTY
public static final java.lang.String CHROME_DRIVER_LOG_PROPERTY
System property that defines the location of the file where ChromeDriver should write log messages to.- See Also:
- Constant Field Values
-
CHROME_DRIVER_LOG_LEVEL_PROPERTY
public static final java.lang.String CHROME_DRIVER_LOG_LEVEL_PROPERTY
System property that defines theChromiumDriverLogLevel
for ChromeDriver logs.- See Also:
- Constant Field Values
-
CHROME_DRIVER_APPEND_LOG_PROPERTY
public static final java.lang.String CHROME_DRIVER_APPEND_LOG_PROPERTY
Boolean system property that defines whether ChromeDriver should append to existing log file.- See Also:
- Constant Field Values
-
CHROME_DRIVER_VERBOSE_LOG_PROPERTY
public static final java.lang.String CHROME_DRIVER_VERBOSE_LOG_PROPERTY
Boolean system property that defines whether the ChromeDriver executable should be started with verbose logging.- See Also:
- Constant Field Values
-
CHROME_DRIVER_SILENT_OUTPUT_PROPERTY
public static final java.lang.String CHROME_DRIVER_SILENT_OUTPUT_PROPERTY
Boolean system property that defines whether the ChromeDriver executable should be started in silent mode.- See Also:
- Constant Field Values
-
CHROME_DRIVER_ALLOWED_IPS_PROPERTY
public static final java.lang.String CHROME_DRIVER_ALLOWED_IPS_PROPERTY
System property that defines comma-separated list of remote IPv4 addresses which are allowed to connect to ChromeDriver.- See Also:
- Constant Field Values
-
CHROME_DRIVER_WHITELISTED_IPS_PROPERTY
@Deprecated public static final java.lang.String CHROME_DRIVER_WHITELISTED_IPS_PROPERTY
Deprecated.System property that defines comma-separated list of remote IPv4 addresses which are allowed to connect to ChromeDriver.- See Also:
- Constant Field Values
-
CHROME_DRIVER_DISABLE_BUILD_CHECK
public static final java.lang.String CHROME_DRIVER_DISABLE_BUILD_CHECK
System property that defines whether the ChromeDriver executable should check for build version compatibility between ChromeDriver and the browser.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
ChromeDriverService
@Deprecated public ChromeDriverService(java.io.File executable, int port, java.util.List<java.lang.String> args, java.util.Map<java.lang.String,java.lang.String> environment) throws java.io.IOException
Deprecated.- Parameters:
executable
- The ChromeDriver executable.port
- Which port to start the ChromeDriver on.args
- The arguments to the launched server.environment
- The environment for the launched server.- Throws:
java.io.IOException
- If an I/O error occurs.
-
ChromeDriverService
public ChromeDriverService(java.io.File executable, int port, java.time.Duration timeout, java.util.List<java.lang.String> args, java.util.Map<java.lang.String,java.lang.String> environment) throws java.io.IOException
- Parameters:
executable
- The ChromeDriver executable.port
- Which port to start the ChromeDriver on.timeout
- Timeout waiting for driver server to start.args
- The arguments to the launched server.environment
- The environment for the launched server.- Throws:
java.io.IOException
- If an I/O error occurs.
-
-
Method Detail
-
getDriverName
public java.lang.String getDriverName()
- Overrides:
getDriverName
in classorg.openqa.selenium.remote.service.DriverService
-
getDriverProperty
public java.lang.String getDriverProperty()
- Overrides:
getDriverProperty
in classorg.openqa.selenium.remote.service.DriverService
-
getDefaultDriverOptions
public org.openqa.selenium.Capabilities getDefaultDriverOptions()
- Overrides:
getDefaultDriverOptions
in classorg.openqa.selenium.remote.service.DriverService
-
createDefaultService
public static ChromeDriverService createDefaultService()
Configures and returns a newChromeDriverService
using the default configuration. In this configuration, the service will use the ChromeDriver executable identified byDriverFinder.getPath(DriverService, Capabilities)
. Each service created by this method will be configured to use a free port on the current system.- Returns:
- A new ChromeDriverService using the default configuration.
-
createServiceWithConfig
@Deprecated public static ChromeDriverService createServiceWithConfig(ChromeOptions options)
Deprecated.Configures and returns a newChromeDriverService
using the supplied configuration. In this configuration, the service will use the ChromeDriver executable identified byDriverFinder.getPath(DriverService, Capabilities)
. Each service created by this method will be configured to use a free port on the current system.- Returns:
- A new ChromeDriverService using the supplied configuration from
ChromeOptions
.
-
-