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.interactions.Interactive,org.openqa.selenium.JavascriptExecutor,org.openqa.selenium.logging.HasLogEvents,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
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.WhenNested 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
ConstructorsModifierConstructorDescriptionprotectedChromiumDriver(org.openqa.selenium.remote.CommandExecutor commandExecutor, org.openqa.selenium.Capabilities capabilities, String capabilityKey) -
Method Summary
Modifier and TypeMethodDescriptionvoidResets 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.CapabilitiesReturns the list of cast sinks (Cast devices) available to the Chrome media router.Gets map of network conditions.Set<org.openqa.selenium.ScriptKey> voidOptional<org.openqa.selenium.bidi.BiDi> Optional<org.openqa.selenium.devtools.DevTools> <X> voidonLogEvent(org.openqa.selenium.logging.EventType<X> kind) org.openqa.selenium.ScriptKeyvoidquit()voidregister(Predicate<URI> whenThisMatches, Supplier<org.openqa.selenium.Credentials> useTheseCredentials) voidselectCastSink(String deviceName) Selects a cast sink (Cast device) as the recipient of media router intents (connect or play).voidsetFileDetector(org.openqa.selenium.remote.FileDetector detector) voidsetNetworkConditions(ChromiumNetworkConditions networkConditions) Set network limitationsvoidsetPermission(String name, String value) voidstartDesktopMirroring(String deviceName) Initiates desktop mirroring for the current browser tab on the specified device.voidstartTabMirroring(String deviceName) Initiates tab mirroring for the current browser tab on the specified device.voidstopCasting(String deviceName) Stops casting from media router to the specified device, if connected.voidunpin(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, isDownloadsEnabled, log, manage, navigate, network, perform, print, removeVirtualAuthenticator, resetCooldown, resetInputState, script, setCommandExecutor, setDelayEnabled, setElementConverter, setErrorHandler, setFoundBy, setLogLevel, setSessionId, startSession, switchTo, toStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.openqa.selenium.HasAuthentication
registerMethods inherited from interface org.openqa.selenium.bidi.HasBiDi
getBiDiMethods inherited from interface org.openqa.selenium.devtools.HasDevTools
getDevToolsMethods 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:
getCapabilitiesin interfaceorg.openqa.selenium.HasCapabilities- Overrides:
getCapabilitiesin classorg.openqa.selenium.remote.RemoteWebDriver
-
pin
- Specified by:
pinin interfaceorg.openqa.selenium.JavascriptExecutor
-
getPinnedScripts
- Specified by:
getPinnedScriptsin interfaceorg.openqa.selenium.JavascriptExecutor
-
unpin
public void unpin(org.openqa.selenium.ScriptKey key) - Specified by:
unpinin interfaceorg.openqa.selenium.JavascriptExecutor
-
executeScript
- Specified by:
executeScriptin interfaceorg.openqa.selenium.JavascriptExecutor
-
setFileDetector
public void setFileDetector(org.openqa.selenium.remote.FileDetector detector) - Overrides:
setFileDetectorin classorg.openqa.selenium.remote.RemoteWebDriver
-
onLogEvent
public <X> void onLogEvent(org.openqa.selenium.logging.EventType<X> kind) - Specified by:
onLogEventin interfaceorg.openqa.selenium.logging.HasLogEvents
-
register
public void register(Predicate<URI> whenThisMatches, Supplier<org.openqa.selenium.Credentials> useTheseCredentials) - Specified by:
registerin interfaceorg.openqa.selenium.HasAuthentication
-
launchApp
- Specified by:
launchAppin interfaceHasLaunchApp- Parameters:
id- which Chromium app to launch.
-
executeCdpCommand
Description copied from interface:HasCdpExecute 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
DevToolsAPI instead of this- Specified by:
executeCdpCommandin 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:
maybeGetDevToolsin interfaceorg.openqa.selenium.devtools.HasDevTools
-
maybeGetBiDi
- Specified by:
maybeGetBiDiin interfaceorg.openqa.selenium.bidi.HasBiDi
-
getCastSinks
Description copied from interface:HasCastingReturns the list of cast sinks (Cast devices) available to the Chrome media router.- Specified by:
getCastSinksin interfaceHasCasting- Returns:
- array of ID / Name pairs of available cast sink targets
-
getCastIssueMessage
- Specified by:
getCastIssueMessagein interfaceHasCasting- Returns:
- an error message if there is any issue in a Cast session.
-
selectCastSink
Description copied from interface:HasCastingSelects a cast sink (Cast device) as the recipient of media router intents (connect or play).- Specified by:
selectCastSinkin interfaceHasCasting- Parameters:
deviceName- name of the target device.
-
startDesktopMirroring
Description copied from interface:HasCastingInitiates desktop mirroring for the current browser tab on the specified device.- Specified by:
startDesktopMirroringin interfaceHasCasting- Parameters:
deviceName- name of the target device.
-
startTabMirroring
Description copied from interface:HasCastingInitiates tab mirroring for the current browser tab on the specified device.- Specified by:
startTabMirroringin interfaceHasCasting- Parameters:
deviceName- name of the target device.
-
stopCasting
Description copied from interface:HasCastingStops casting from media router to the specified device, if connected.- Specified by:
stopCastingin interfaceHasCasting- Parameters:
deviceName- name of the target device.
-
setPermission
- Specified by:
setPermissionin interfaceHasPermissions- Parameters:
name- what item to set the permission on.value- what to set the permission to.
-
getNetworkConditions
Description copied from interface:HasNetworkConditionsGets map of network conditions. These have to be set before they can be retrieved.- Specified by:
getNetworkConditionsin interfaceHasNetworkConditions- Returns:
- the current network condition values.
-
setNetworkConditions
Description copied from interface:HasNetworkConditionsSet network limitations- Specified by:
setNetworkConditionsin interfaceHasNetworkConditions- Parameters:
networkConditions- object containing valid network condition settings.
-
deleteNetworkConditions
public void deleteNetworkConditions()Description copied from interface:HasNetworkConditionsResets the network conditions to the default settings.- Specified by:
deleteNetworkConditionsin interfaceHasNetworkConditions
-
quit
public void quit()- Specified by:
quitin interfaceorg.openqa.selenium.WebDriver- Overrides:
quitin classorg.openqa.selenium.remote.RemoteWebDriver
-