Package org.openqa.selenium.chromium
Class ChromiumDriver
- java.lang.Object
-
- org.openqa.selenium.remote.RemoteWebDriver
-
- org.openqa.selenium.chromium.ChromiumDriver
-
- All Implemented Interfaces:
HasCasting,HasCdp,HasLaunchApp,HasNetworkConditions,HasPermissions,org.openqa.selenium.devtools.HasDevTools,org.openqa.selenium.HasAuthentication,org.openqa.selenium.HasCapabilities,org.openqa.selenium.html5.LocationContext,org.openqa.selenium.html5.WebStorage,org.openqa.selenium.interactions.HasInputDevices,org.openqa.selenium.interactions.HasTouchScreen,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, HasCasting, HasCdp, org.openqa.selenium.devtools.HasDevTools, HasLaunchApp, org.openqa.selenium.logging.HasLogEvents, HasNetworkConditions, HasPermissions, org.openqa.selenium.interactions.HasTouchScreen, org.openqa.selenium.html5.LocationContext, org.openqa.selenium.mobile.NetworkConnection, org.openqa.selenium.html5.WebStorage
AWebDriverimplementation that controls a Chromium browser running on the local machine. It is used as the base class for Chromium-based browser drivers (Chrome, Edgium).
-
-
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.ImeHandler, 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 Modifier and Type Field Description protected HasCastingcastingprotected HasCdpcdpstatic java.util.function.Predicate<java.lang.String>IS_CHROMIUM_BROWSER
-
Constructor Summary
Constructors Modifier Constructor Description protectedChromiumDriver(org.openqa.selenium.remote.CommandExecutor commandExecutor, org.openqa.selenium.Capabilities capabilities, java.lang.String capabilityKey)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddeleteNetworkConditions()Resets the network conditions to the default settings.java.util.Map<java.lang.String,java.lang.Object>executeCdpCommand(java.lang.String commandName, java.util.Map<java.lang.String,java.lang.Object> parameters)Execute a Chrome DevTools Protocol command and get returned result.org.openqa.selenium.CapabilitiesgetCapabilities()java.lang.StringgetCastIssueMessage()java.util.List<java.util.Map<java.lang.String,java.lang.String>>getCastSinks()Returns the list of cast sinks (Cast devices) available to the Chrome media router.org.openqa.selenium.html5.LocalStoragegetLocalStorage()ChromiumNetworkConditionsgetNetworkConditions()Gets map of network conditions.org.openqa.selenium.mobile.NetworkConnection.ConnectionTypegetNetworkConnection()org.openqa.selenium.html5.SessionStoragegetSessionStorage()org.openqa.selenium.interactions.TouchScreengetTouch()voidlaunchApp(java.lang.String id)org.openqa.selenium.html5.Locationlocation()java.util.Optional<org.openqa.selenium.devtools.DevTools>maybeGetDevTools()<X> voidonLogEvent(org.openqa.selenium.logging.EventType<X> kind)voidquit()voidregister(java.util.function.Predicate<java.net.URI> whenThisMatches, java.util.function.Supplier<org.openqa.selenium.Credentials> useTheseCredentials)voidselectCastSink(java.lang.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)voidsetLocation(org.openqa.selenium.html5.Location location)voidsetNetworkConditions(ChromiumNetworkConditions networkConditions)Set network limitationsorg.openqa.selenium.mobile.NetworkConnection.ConnectionTypesetNetworkConnection(org.openqa.selenium.mobile.NetworkConnection.ConnectionType type)voidsetPermission(java.lang.String name, java.lang.String value)voidstartTabMirroring(java.lang.String deviceName)Initiates tab mirroring for the current browser tab on the specified device.voidstopCasting(java.lang.String deviceName)Stops casting from media router to the specified device, if connected.-
Methods inherited from class org.openqa.selenium.remote.RemoteWebDriver
addVirtualAuthenticator, builder, close, execute, execute, execute, executeAsyncScript, executeScript, findElement, findElement, findElements, findElements, findElements, get, getCommandExecutor, getCurrentUrl, getElementConverter, getErrorHandler, getExecuteMethod, getFileDetector, getKeyboard, getMouse, getPageSource, getScreenshotAs, getSessionId, getTitle, getWindowHandle, getWindowHandles, log, manage, navigate, perform, print, removeVirtualAuthenticator, resetInputState, setCommandExecutor, setElementConverter, setErrorHandler, setFoundBy, setLogLevel, setSessionId, startSession, switchTo, toString
-
-
-
-
Field Detail
-
IS_CHROMIUM_BROWSER
public static final java.util.function.Predicate<java.lang.String> IS_CHROMIUM_BROWSER
-
casting
protected HasCasting casting
-
cdp
protected HasCdp cdp
-
-
Method Detail
-
getCapabilities
public org.openqa.selenium.Capabilities getCapabilities()
- Specified by:
getCapabilitiesin interfaceorg.openqa.selenium.HasCapabilities- Overrides:
getCapabilitiesin classorg.openqa.selenium.remote.RemoteWebDriver
-
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(java.util.function.Predicate<java.net.URI> whenThisMatches, java.util.function.Supplier<org.openqa.selenium.Credentials> useTheseCredentials)- Specified by:
registerin interfaceorg.openqa.selenium.HasAuthentication
-
getLocalStorage
public org.openqa.selenium.html5.LocalStorage getLocalStorage()
- Specified by:
getLocalStoragein interfaceorg.openqa.selenium.html5.WebStorage
-
getSessionStorage
public org.openqa.selenium.html5.SessionStorage getSessionStorage()
- Specified by:
getSessionStoragein interfaceorg.openqa.selenium.html5.WebStorage
-
location
public org.openqa.selenium.html5.Location location()
- Specified by:
locationin interfaceorg.openqa.selenium.html5.LocationContext
-
setLocation
public void setLocation(org.openqa.selenium.html5.Location location)
- Specified by:
setLocationin interfaceorg.openqa.selenium.html5.LocationContext
-
getTouch
public org.openqa.selenium.interactions.TouchScreen getTouch()
- Specified by:
getTouchin interfaceorg.openqa.selenium.interactions.HasTouchScreen
-
getNetworkConnection
public org.openqa.selenium.mobile.NetworkConnection.ConnectionType getNetworkConnection()
- Specified by:
getNetworkConnectionin interfaceorg.openqa.selenium.mobile.NetworkConnection
-
setNetworkConnection
public org.openqa.selenium.mobile.NetworkConnection.ConnectionType setNetworkConnection(org.openqa.selenium.mobile.NetworkConnection.ConnectionType type)
- Specified by:
setNetworkConnectionin interfaceorg.openqa.selenium.mobile.NetworkConnection
-
launchApp
public void launchApp(java.lang.String id)
- Specified by:
launchAppin interfaceHasLaunchApp- Parameters:
id- which Chromium app to launch.
-
executeCdpCommand
public java.util.Map<java.lang.String,java.lang.Object> executeCdpCommand(java.lang.String commandName, java.util.Map<java.lang.String,java.lang.Object> parameters)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 useDevToolsAPI 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
public java.util.Optional<org.openqa.selenium.devtools.DevTools> maybeGetDevTools()
- Specified by:
maybeGetDevToolsin interfaceorg.openqa.selenium.devtools.HasDevTools
-
getCastSinks
public java.util.List<java.util.Map<java.lang.String,java.lang.String>> 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
public java.lang.String getCastIssueMessage()
- Specified by:
getCastIssueMessagein interfaceHasCasting- Returns:
- an error message if there is any issue in a Cast session.
-
selectCastSink
public void selectCastSink(java.lang.String deviceName)
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.
-
startTabMirroring
public void startTabMirroring(java.lang.String deviceName)
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
public void stopCasting(java.lang.String deviceName)
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
public void setPermission(java.lang.String name, java.lang.String value)- Specified by:
setPermissionin interfaceHasPermissions- Parameters:
name- what item to set the permission on.value- what to set the permission to.
-
getNetworkConditions
public ChromiumNetworkConditions 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
public void setNetworkConditions(ChromiumNetworkConditions networkConditions)
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
-
-