Package org.openqa.selenium.chromium
Class ChromiumDriver
java.lang.Object
org.openqa.selenium.remote.RemoteWebDriver
org.openqa.selenium.chromium.ChromiumDriver
- All Implemented Interfaces:
org.openqa.selenium.bidi.HasBiDi
,HasCasting
,HasCdp
,HasLaunchApp
,HasNetworkConditions
,HasPermissions
,org.openqa.selenium.devtools.HasDevTools
,org.openqa.selenium.federatedcredentialmanagement.HasFederatedCredentialManagement
,org.openqa.selenium.HasAuthentication
,org.openqa.selenium.HasCapabilities
,org.openqa.selenium.HasDownloads
,org.openqa.selenium.html5.LocationContext
,org.openqa.selenium.html5.WebStorage
,org.openqa.selenium.interactions.Interactive
,org.openqa.selenium.JavascriptExecutor
,org.openqa.selenium.logging.HasLogEvents
,org.openqa.selenium.mobile.NetworkConnection
,org.openqa.selenium.PrintsPage
,org.openqa.selenium.SearchContext
,org.openqa.selenium.TakesScreenshot
,org.openqa.selenium.virtualauthenticator.HasVirtualAuthenticator
,org.openqa.selenium.WebDriver
public class ChromiumDriver
extends org.openqa.selenium.remote.RemoteWebDriver
implements org.openqa.selenium.HasAuthentication, org.openqa.selenium.bidi.HasBiDi, HasCasting, HasCdp, org.openqa.selenium.devtools.HasDevTools, HasLaunchApp, org.openqa.selenium.logging.HasLogEvents, HasNetworkConditions, HasPermissions, org.openqa.selenium.html5.LocationContext, org.openqa.selenium.mobile.NetworkConnection, org.openqa.selenium.html5.WebStorage
A
WebDriver
implementation that controls a Chromium browser running on the local machine.
It is used as the base class for Chromium-based browser drivers (Chrome, Edge).-
Nested Class Summary
Nested classes/interfaces inherited from class org.openqa.selenium.remote.RemoteWebDriver
org.openqa.selenium.remote.RemoteWebDriver.RemoteTargetLocator, org.openqa.selenium.remote.RemoteWebDriver.RemoteWebDriverOptions, org.openqa.selenium.remote.RemoteWebDriver.When
Nested classes/interfaces inherited from interface org.openqa.selenium.mobile.NetworkConnection
org.openqa.selenium.mobile.NetworkConnection.ConnectionType
Nested classes/interfaces inherited from interface org.openqa.selenium.WebDriver
org.openqa.selenium.WebDriver.Navigation, org.openqa.selenium.WebDriver.Options, org.openqa.selenium.WebDriver.TargetLocator, org.openqa.selenium.WebDriver.Timeouts, org.openqa.selenium.WebDriver.Window
-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
ChromiumDriver
(org.openqa.selenium.remote.CommandExecutor commandExecutor, org.openqa.selenium.Capabilities capabilities, String capabilityKey) -
Method Summary
Modifier and TypeMethodDescriptionvoid
Resets the network conditions to the default settings.executeCdpCommand
(String commandName, Map<String, Object> parameters) Execute a Chrome DevTools Protocol command and get returned result.executeScript
(org.openqa.selenium.ScriptKey key, Object... args) org.openqa.selenium.Capabilities
Returns the list of cast sinks (Cast devices) available to the Chrome media router.org.openqa.selenium.html5.LocalStorage
Deprecated.Gets map of network conditions.org.openqa.selenium.mobile.NetworkConnection.ConnectionType
Deprecated.Set<org.openqa.selenium.ScriptKey>
org.openqa.selenium.html5.SessionStorage
Deprecated.void
org.openqa.selenium.html5.Location
location()
Deprecated.Optional<org.openqa.selenium.bidi.BiDi>
Optional<org.openqa.selenium.devtools.DevTools>
<X> void
onLogEvent
(org.openqa.selenium.logging.EventType<X> kind) org.openqa.selenium.ScriptKey
void
quit()
void
register
(Predicate<URI> whenThisMatches, Supplier<org.openqa.selenium.Credentials> useTheseCredentials) void
selectCastSink
(String deviceName) Selects a cast sink (Cast device) as the recipient of media router intents (connect or play).void
setFileDetector
(org.openqa.selenium.remote.FileDetector detector) void
setLocation
(org.openqa.selenium.html5.Location location) Deprecated.void
setNetworkConditions
(ChromiumNetworkConditions networkConditions) Set network limitationsorg.openqa.selenium.mobile.NetworkConnection.ConnectionType
setNetworkConnection
(org.openqa.selenium.mobile.NetworkConnection.ConnectionType type) Deprecated.void
setPermission
(String name, String value) void
startDesktopMirroring
(String deviceName) Initiates desktop mirroring for the current browser tab on the specified device.void
startTabMirroring
(String deviceName) Initiates tab mirroring for the current browser tab on the specified device.void
stopCasting
(String deviceName) Stops casting from media router to the specified device, if connected.void
unpin
(org.openqa.selenium.ScriptKey key) Methods inherited from class org.openqa.selenium.remote.RemoteWebDriver
addVirtualAuthenticator, builder, close, deleteDownloadableFiles, downloadFile, execute, execute, execute, executeAsyncScript, executeScript, findElement, findElements, findElements, get, getCommandExecutor, getCurrentUrl, getDownloadableFiles, getElementConverter, getErrorHandler, getExecuteMethod, getFederatedCredentialManagementDialog, getFileDetector, getPageSource, getScreenshotAs, getSessionId, getTitle, getWindowHandle, getWindowHandles, log, manage, navigate, perform, print, removeVirtualAuthenticator, resetCooldown, resetInputState, script, setCommandExecutor, setDelayEnabled, setElementConverter, setErrorHandler, setFoundBy, setLogLevel, setSessionId, startSession, switchTo, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.openqa.selenium.HasAuthentication
register
Methods inherited from interface org.openqa.selenium.bidi.HasBiDi
getBiDi
Methods inherited from interface org.openqa.selenium.devtools.HasDevTools
getDevTools
Methods inherited from interface org.openqa.selenium.HasDownloads
requireDownloadsEnabled
-
Field Details
-
IS_CHROMIUM_BROWSER
-
casting
-
cdp
-
-
Constructor Details
-
ChromiumDriver
protected ChromiumDriver(org.openqa.selenium.remote.CommandExecutor commandExecutor, org.openqa.selenium.Capabilities capabilities, String capabilityKey)
-
-
Method Details
-
getCapabilities
public org.openqa.selenium.Capabilities getCapabilities()- Specified by:
getCapabilities
in interfaceorg.openqa.selenium.HasCapabilities
- Overrides:
getCapabilities
in classorg.openqa.selenium.remote.RemoteWebDriver
-
pin
- Specified by:
pin
in interfaceorg.openqa.selenium.JavascriptExecutor
-
getPinnedScripts
- Specified by:
getPinnedScripts
in interfaceorg.openqa.selenium.JavascriptExecutor
-
unpin
public void unpin(org.openqa.selenium.ScriptKey key) - Specified by:
unpin
in interfaceorg.openqa.selenium.JavascriptExecutor
-
executeScript
- Specified by:
executeScript
in interfaceorg.openqa.selenium.JavascriptExecutor
-
setFileDetector
public void setFileDetector(org.openqa.selenium.remote.FileDetector detector) - Overrides:
setFileDetector
in classorg.openqa.selenium.remote.RemoteWebDriver
-
onLogEvent
public <X> void onLogEvent(org.openqa.selenium.logging.EventType<X> kind) - Specified by:
onLogEvent
in interfaceorg.openqa.selenium.logging.HasLogEvents
-
register
public void register(Predicate<URI> whenThisMatches, Supplier<org.openqa.selenium.Credentials> useTheseCredentials) - Specified by:
register
in interfaceorg.openqa.selenium.HasAuthentication
-
getLocalStorage
Deprecated.- Specified by:
getLocalStorage
in interfaceorg.openqa.selenium.html5.WebStorage
-
getSessionStorage
Deprecated.- Specified by:
getSessionStorage
in interfaceorg.openqa.selenium.html5.WebStorage
-
location
Deprecated.- Specified by:
location
in interfaceorg.openqa.selenium.html5.LocationContext
-
setLocation
Deprecated.- Specified by:
setLocation
in interfaceorg.openqa.selenium.html5.LocationContext
-
getNetworkConnection
@Deprecated public org.openqa.selenium.mobile.NetworkConnection.ConnectionType getNetworkConnection()Deprecated.- Specified by:
getNetworkConnection
in interfaceorg.openqa.selenium.mobile.NetworkConnection
-
setNetworkConnection
@Deprecated public org.openqa.selenium.mobile.NetworkConnection.ConnectionType setNetworkConnection(org.openqa.selenium.mobile.NetworkConnection.ConnectionType type) Deprecated.- Specified by:
setNetworkConnection
in interfaceorg.openqa.selenium.mobile.NetworkConnection
-
launchApp
- Specified by:
launchApp
in interfaceHasLaunchApp
- Parameters:
id
- which Chromium app to launch.
-
executeCdpCommand
Description copied from interface:HasCdp
Execute a Chrome DevTools Protocol command and get returned result. The command and command args should follow chrome devtools protocol domains/commands.It is strongly encouraged to use
DevTools
API instead of this- Specified by:
executeCdpCommand
in interfaceHasCdp
- Parameters:
commandName
- the command to execute with Chrome Dev Tools.parameters
- any information needed to execute the Dev Tools command.- Returns:
- the name and value of the response.
-
maybeGetDevTools
- Specified by:
maybeGetDevTools
in interfaceorg.openqa.selenium.devtools.HasDevTools
-
maybeGetBiDi
- Specified by:
maybeGetBiDi
in interfaceorg.openqa.selenium.bidi.HasBiDi
-
getCastSinks
Description copied from interface:HasCasting
Returns the list of cast sinks (Cast devices) available to the Chrome media router.- Specified by:
getCastSinks
in interfaceHasCasting
- Returns:
- array of ID / Name pairs of available cast sink targets
-
getCastIssueMessage
- Specified by:
getCastIssueMessage
in interfaceHasCasting
- Returns:
- an error message if there is any issue in a Cast session.
-
selectCastSink
Description copied from interface:HasCasting
Selects a cast sink (Cast device) as the recipient of media router intents (connect or play).- Specified by:
selectCastSink
in interfaceHasCasting
- Parameters:
deviceName
- name of the target device.
-
startDesktopMirroring
Description copied from interface:HasCasting
Initiates desktop mirroring for the current browser tab on the specified device.- Specified by:
startDesktopMirroring
in interfaceHasCasting
- Parameters:
deviceName
- name of the target device.
-
startTabMirroring
Description copied from interface:HasCasting
Initiates tab mirroring for the current browser tab on the specified device.- Specified by:
startTabMirroring
in interfaceHasCasting
- Parameters:
deviceName
- name of the target device.
-
stopCasting
Description copied from interface:HasCasting
Stops casting from media router to the specified device, if connected.- Specified by:
stopCasting
in interfaceHasCasting
- Parameters:
deviceName
- name of the target device.
-
setPermission
- Specified by:
setPermission
in interfaceHasPermissions
- Parameters:
name
- what item to set the permission on.value
- what to set the permission to.
-
getNetworkConditions
Description copied from interface:HasNetworkConditions
Gets map of network conditions. These have to be set before they can be retrieved.- Specified by:
getNetworkConditions
in interfaceHasNetworkConditions
- Returns:
- the current network condition values.
-
setNetworkConditions
Description copied from interface:HasNetworkConditions
Set network limitations- Specified by:
setNetworkConditions
in interfaceHasNetworkConditions
- Parameters:
networkConditions
- object containing valid network condition settings.
-
deleteNetworkConditions
public void deleteNetworkConditions()Description copied from interface:HasNetworkConditions
Resets the network conditions to the default settings.- Specified by:
deleteNetworkConditions
in interfaceHasNetworkConditions
-
quit
public void quit()- Specified by:
quit
in interfaceorg.openqa.selenium.WebDriver
- Overrides:
quit
in classorg.openqa.selenium.remote.RemoteWebDriver
-