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.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
    Modifier and Type
    Field
    Description
    protected HasCasting
     
    protected HasCdp
     
    static final Predicate<String>
     
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    ChromiumDriver(org.openqa.selenium.remote.CommandExecutor commandExecutor, org.openqa.selenium.Capabilities capabilities, String capabilityKey)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    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.
    org.openqa.selenium.Capabilities
     
     
    Returns the list of cast sinks (Cast devices) available to the Chrome media router.
    org.openqa.selenium.html5.LocalStorage
     
    Gets map of network conditions.
    org.openqa.selenium.mobile.NetworkConnection.ConnectionType
     
    org.openqa.selenium.html5.SessionStorage
     
    void
     
    org.openqa.selenium.html5.Location
     
    Optional<org.openqa.selenium.bidi.BiDi>
     
    Optional<org.openqa.selenium.devtools.DevTools>
     
    <X> void
    onLogEvent(org.openqa.selenium.logging.EventType<X> kind)
     
    void
     
    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)
     
    void
    Set network limitations
    org.openqa.selenium.mobile.NetworkConnection.ConnectionType
    setNetworkConnection(org.openqa.selenium.mobile.NetworkConnection.ConnectionType type)
     
    void
    setPermission(String name, String value)
     
    void
    Initiates desktop mirroring for the current browser tab on the specified device.
    void
    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.

    Methods inherited from class org.openqa.selenium.remote.RemoteWebDriver

    addVirtualAuthenticator, builder, close, execute, execute, execute, executeAsyncScript, executeScript, executeScript, findElement, findElements, findElements, get, getCommandExecutor, getCurrentUrl, getElementConverter, getErrorHandler, getExecuteMethod, getFederatedCredentialManagementDialog, getFileDetector, getPageSource, getScreenshotAs, getSessionId, getTitle, getWindowHandle, getWindowHandles, log, manage, navigate, perform, pin, print, removeVirtualAuthenticator, resetCooldown, resetInputState, setCommandExecutor, setDelayEnabled, setElementConverter, setErrorHandler, setFoundBy, setLogLevel, setSessionId, startSession, switchTo, toString, unpin

    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.JavascriptExecutor

    getPinnedScripts
  • Field Details

  • 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 interface org.openqa.selenium.HasCapabilities
      Overrides:
      getCapabilities in class org.openqa.selenium.remote.RemoteWebDriver
    • setFileDetector

      public void setFileDetector(org.openqa.selenium.remote.FileDetector detector)
      Overrides:
      setFileDetector in class org.openqa.selenium.remote.RemoteWebDriver
    • onLogEvent

      public <X> void onLogEvent(org.openqa.selenium.logging.EventType<X> kind)
      Specified by:
      onLogEvent in interface org.openqa.selenium.logging.HasLogEvents
    • register

      public void register(Predicate<URI> whenThisMatches, Supplier<org.openqa.selenium.Credentials> useTheseCredentials)
      Specified by:
      register in interface org.openqa.selenium.HasAuthentication
    • getLocalStorage

      public org.openqa.selenium.html5.LocalStorage getLocalStorage()
      Specified by:
      getLocalStorage in interface org.openqa.selenium.html5.WebStorage
    • getSessionStorage

      public org.openqa.selenium.html5.SessionStorage getSessionStorage()
      Specified by:
      getSessionStorage in interface org.openqa.selenium.html5.WebStorage
    • location

      public org.openqa.selenium.html5.Location location()
      Specified by:
      location in interface org.openqa.selenium.html5.LocationContext
    • setLocation

      public void setLocation(org.openqa.selenium.html5.Location location)
      Specified by:
      setLocation in interface org.openqa.selenium.html5.LocationContext
    • getNetworkConnection

      public org.openqa.selenium.mobile.NetworkConnection.ConnectionType getNetworkConnection()
      Specified by:
      getNetworkConnection in interface org.openqa.selenium.mobile.NetworkConnection
    • setNetworkConnection

      public org.openqa.selenium.mobile.NetworkConnection.ConnectionType setNetworkConnection(org.openqa.selenium.mobile.NetworkConnection.ConnectionType type)
      Specified by:
      setNetworkConnection in interface org.openqa.selenium.mobile.NetworkConnection
    • launchApp

      public void launchApp(String id)
      Specified by:
      launchApp in interface HasLaunchApp
      Parameters:
      id - which Chromium app to launch.
    • executeCdpCommand

      public Map<String,Object> executeCdpCommand(String commandName, Map<String,Object> parameters)
      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 interface HasCdp
      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 Optional<org.openqa.selenium.devtools.DevTools> maybeGetDevTools()
      Specified by:
      maybeGetDevTools in interface org.openqa.selenium.devtools.HasDevTools
    • maybeGetBiDi

      public Optional<org.openqa.selenium.bidi.BiDi> maybeGetBiDi()
      Specified by:
      maybeGetBiDi in interface org.openqa.selenium.bidi.HasBiDi
    • getCastSinks

      public List<Map<String,String>> getCastSinks()
      Description copied from interface: HasCasting
      Returns the list of cast sinks (Cast devices) available to the Chrome media router.
      Specified by:
      getCastSinks in interface HasCasting
      Returns:
      array of ID / Name pairs of available cast sink targets
    • getCastIssueMessage

      public String getCastIssueMessage()
      Specified by:
      getCastIssueMessage in interface HasCasting
      Returns:
      an error message if there is any issue in a Cast session.
    • selectCastSink

      public void selectCastSink(String deviceName)
      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 interface HasCasting
      Parameters:
      deviceName - name of the target device.
    • startDesktopMirroring

      public void startDesktopMirroring(String deviceName)
      Description copied from interface: HasCasting
      Initiates desktop mirroring for the current browser tab on the specified device.
      Specified by:
      startDesktopMirroring in interface HasCasting
      Parameters:
      deviceName - name of the target device.
    • startTabMirroring

      public void startTabMirroring(String deviceName)
      Description copied from interface: HasCasting
      Initiates tab mirroring for the current browser tab on the specified device.
      Specified by:
      startTabMirroring in interface HasCasting
      Parameters:
      deviceName - name of the target device.
    • stopCasting

      public void stopCasting(String deviceName)
      Description copied from interface: HasCasting
      Stops casting from media router to the specified device, if connected.
      Specified by:
      stopCasting in interface HasCasting
      Parameters:
      deviceName - name of the target device.
    • setPermission

      public void setPermission(String name, String value)
      Specified by:
      setPermission in interface HasPermissions
      Parameters:
      name - what item to set the permission on.
      value - what to set the permission to.
    • getNetworkConditions

      public ChromiumNetworkConditions 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 interface HasNetworkConditions
      Returns:
      the current network condition values.
    • setNetworkConditions

      public void setNetworkConditions(ChromiumNetworkConditions networkConditions)
      Description copied from interface: HasNetworkConditions
      Set network limitations
      Specified by:
      setNetworkConditions in interface HasNetworkConditions
      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 interface HasNetworkConditions
    • quit

      public void quit()
      Specified by:
      quit in interface org.openqa.selenium.WebDriver
      Overrides:
      quit in class org.openqa.selenium.remote.RemoteWebDriver