Class ChromiumDriver

  • All Implemented Interfaces:
    org.openqa.selenium.devtools.HasDevTools, 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.internal.FindsByClassName, org.openqa.selenium.internal.FindsByCssSelector, org.openqa.selenium.internal.FindsById, org.openqa.selenium.internal.FindsByLinkText, org.openqa.selenium.internal.FindsByName, org.openqa.selenium.internal.FindsByTagName, org.openqa.selenium.internal.FindsByXPath, org.openqa.selenium.JavascriptExecutor, org.openqa.selenium.mobile.NetworkConnection, org.openqa.selenium.SearchContext, org.openqa.selenium.TakesScreenshot, org.openqa.selenium.WebDriver

    public class ChromiumDriver
    extends org.openqa.selenium.remote.RemoteWebDriver
    implements org.openqa.selenium.devtools.HasDevTools, org.openqa.selenium.interactions.HasTouchScreen, 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. This class is provided as a convenience for easily testing the Chromium browser. The control server which each instance communicates with will live and die with the instance. To avoid unnecessarily restarting the ChromiumDriver server with each instance, use a RemoteWebDriver coupled with the desired WebDriverService, which is managed separately. Note that unlike ChromiumDriver, RemoteWebDriver doesn't directly implement role interfaces such as LocationContext and WebStorage. Therefore, to access that functionality, it needs to be augmented and then cast to the appropriate interface.
    • 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
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected ChromiumDriver​(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
      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.
      java.lang.String getCastIssueMessage()  
      java.lang.String getCastSinks()  
      org.openqa.selenium.devtools.DevTools getDevTools()  
      org.openqa.selenium.html5.LocalStorage getLocalStorage()  
      org.openqa.selenium.mobile.NetworkConnection.ConnectionType getNetworkConnection()  
      org.openqa.selenium.html5.SessionStorage getSessionStorage()  
      org.openqa.selenium.interactions.TouchScreen getTouch()  
      void launchApp​(java.lang.String id)
      Launches Chrome app specified by id.
      org.openqa.selenium.html5.Location location()  
      void quit()  
      void selectCastSink​(java.lang.String deviceName)  
      void setFileDetector​(org.openqa.selenium.remote.FileDetector detector)  
      void setLocation​(org.openqa.selenium.html5.Location location)  
      org.openqa.selenium.mobile.NetworkConnection.ConnectionType setNetworkConnection​(org.openqa.selenium.mobile.NetworkConnection.ConnectionType type)  
      void setPermission​(java.lang.String name, java.lang.String value)  
      void startTabMirroring​(java.lang.String deviceName)  
      void stopCasting​(java.lang.String deviceName)  
      • Methods inherited from class org.openqa.selenium.remote.RemoteWebDriver

        builder, close, execute, execute, executeAsyncScript, executeScript, findElement, findElement, findElementByClassName, findElementByCssSelector, findElementById, findElementByLinkText, findElementByName, findElementByPartialLinkText, findElementByTagName, findElementByXPath, findElements, findElements, findElementsByClassName, findElementsByCssSelector, findElementsById, findElementsByLinkText, findElementsByName, findElementsByPartialLinkText, findElementsByTagName, findElementsByXPath, get, getCapabilities, getCommandExecutor, getCurrentUrl, getElementConverter, getErrorHandler, getExecuteMethod, getFileDetector, getKeyboard, getMouse, getPageSource, getScreenshotAs, getSessionId, getTitle, getWindowHandle, getWindowHandles, log, manage, navigate, perform, resetInputState, setCommandExecutor, 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
    • Constructor Detail

      • ChromiumDriver

        protected ChromiumDriver​(org.openqa.selenium.remote.CommandExecutor commandExecutor,
                                 org.openqa.selenium.Capabilities capabilities,
                                 java.lang.String capabilityKey)
    • Method Detail

      • setFileDetector

        public void setFileDetector​(org.openqa.selenium.remote.FileDetector detector)
        Overrides:
        setFileDetector in class org.openqa.selenium.remote.RemoteWebDriver
      • 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
      • getTouch

        public org.openqa.selenium.interactions.TouchScreen getTouch()
        Specified by:
        getTouch in interface org.openqa.selenium.interactions.HasTouchScreen
      • 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​(java.lang.String id)
        Launches Chrome app specified by id.
        Parameters:
        id - Chrome app id.
      • 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)
        Execute a Chrome Devtools Protocol command and get returned result. The command and command args should follow chrome devtools protocol domains/commands.
      • getDevTools

        public org.openqa.selenium.devtools.DevTools getDevTools()
        Specified by:
        getDevTools in interface org.openqa.selenium.devtools.HasDevTools
      • getCastSinks

        public java.lang.String getCastSinks()
      • getCastIssueMessage

        public java.lang.String getCastIssueMessage()
      • selectCastSink

        public void selectCastSink​(java.lang.String deviceName)
      • startTabMirroring

        public void startTabMirroring​(java.lang.String deviceName)
      • stopCasting

        public void stopCasting​(java.lang.String deviceName)
      • setPermission

        public void setPermission​(java.lang.String name,
                                  java.lang.String value)
      • quit

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