public class ChromiumDriver
extends org.openqa.selenium.remote.RemoteWebDriver
implements org.openqa.selenium.html5.LocationContext, org.openqa.selenium.html5.WebStorage, org.openqa.selenium.interactions.HasTouchScreen, org.openqa.selenium.mobile.NetworkConnection
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.org.openqa.selenium.remote.RemoteWebDriver.RemoteTargetLocator, org.openqa.selenium.remote.RemoteWebDriver.RemoteWebDriverOptions, org.openqa.selenium.remote.RemoteWebDriver.Whenorg.openqa.selenium.mobile.NetworkConnection.ConnectionTypeorg.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| Modifier | Constructor and Description |
|---|---|
protected |
ChromiumDriver(org.openqa.selenium.remote.CommandExecutor commandExecutor,
org.openqa.selenium.Capabilities capabilities,
java.lang.String capabilityKey) |
| Modifier and Type | Method and 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.
|
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 |
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) |
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, toStringprotected ChromiumDriver(org.openqa.selenium.remote.CommandExecutor commandExecutor,
org.openqa.selenium.Capabilities capabilities,
java.lang.String capabilityKey)
public void setFileDetector(org.openqa.selenium.remote.FileDetector detector)
setFileDetector in class org.openqa.selenium.remote.RemoteWebDriverpublic org.openqa.selenium.html5.LocalStorage getLocalStorage()
getLocalStorage in interface org.openqa.selenium.html5.WebStoragepublic org.openqa.selenium.html5.SessionStorage getSessionStorage()
getSessionStorage in interface org.openqa.selenium.html5.WebStoragepublic org.openqa.selenium.html5.Location location()
location in interface org.openqa.selenium.html5.LocationContextpublic void setLocation(org.openqa.selenium.html5.Location location)
setLocation in interface org.openqa.selenium.html5.LocationContextpublic org.openqa.selenium.interactions.TouchScreen getTouch()
getTouch in interface org.openqa.selenium.interactions.HasTouchScreenpublic org.openqa.selenium.mobile.NetworkConnection.ConnectionType getNetworkConnection()
getNetworkConnection in interface org.openqa.selenium.mobile.NetworkConnectionpublic org.openqa.selenium.mobile.NetworkConnection.ConnectionType setNetworkConnection(org.openqa.selenium.mobile.NetworkConnection.ConnectionType type)
setNetworkConnection in interface org.openqa.selenium.mobile.NetworkConnectionpublic void launchApp(java.lang.String id)
id - Chrome app id.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)
public org.openqa.selenium.devtools.DevTools getDevTools()
public void quit()
quit in interface org.openqa.selenium.WebDriverquit in class org.openqa.selenium.remote.RemoteWebDriver