public class RemoteWebDriver
extends java.lang.Object
implements org.openqa.selenium.WebDriver, org.openqa.selenium.JavascriptExecutor, org.openqa.selenium.internal.FindsById, org.openqa.selenium.internal.FindsByClassName, org.openqa.selenium.internal.FindsByLinkText, org.openqa.selenium.internal.FindsByName, org.openqa.selenium.internal.FindsByCssSelector, org.openqa.selenium.internal.FindsByTagName, org.openqa.selenium.internal.FindsByXPath, org.openqa.selenium.interactions.HasInputDevices, org.openqa.selenium.HasCapabilities, org.openqa.selenium.TakesScreenshot
Modifier and Type | Class and Description |
---|---|
private class |
RemoteWebDriver.RemoteAlert |
private class |
RemoteWebDriver.RemoteNavigation |
protected class |
RemoteWebDriver.RemoteTargetLocator |
protected class |
RemoteWebDriver.RemoteWebDriverOptions |
static class |
RemoteWebDriver.When |
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
Modifier and Type | Field and Description |
---|---|
private org.openqa.selenium.Capabilities |
capabilities |
private JsonToWebElementConverter |
converter |
private ErrorHandler |
errorHandler |
private ExecuteMethod |
executeMethod |
private CommandExecutor |
executor |
private FileDetector |
fileDetector |
private RemoteKeyboard |
keyboard |
private java.util.logging.Level |
level |
private LocalLogs |
localLogs |
private static java.util.logging.Logger |
logger |
private RemoteMouse |
mouse |
private org.openqa.selenium.logging.Logs |
remoteLogs |
private SessionId |
sessionId |
private int |
w3cComplianceLevel |
Modifier | Constructor and Description |
---|---|
protected |
RemoteWebDriver() |
|
RemoteWebDriver(org.openqa.selenium.Capabilities desiredCapabilities) |
|
RemoteWebDriver(CommandExecutor executor,
org.openqa.selenium.Capabilities desiredCapabilities) |
|
RemoteWebDriver(CommandExecutor executor,
org.openqa.selenium.Capabilities desiredCapabilities,
org.openqa.selenium.Capabilities requiredCapabilities) |
|
RemoteWebDriver(java.net.URL remoteAddress,
org.openqa.selenium.Capabilities desiredCapabilities) |
|
RemoteWebDriver(java.net.URL remoteAddress,
org.openqa.selenium.Capabilities desiredCapabilities,
org.openqa.selenium.Capabilities requiredCapabilities) |
Modifier and Type | Method and Description |
---|---|
void |
close() |
(package private) static java.lang.String |
cssEscape(java.lang.String using) |
protected Response |
execute(java.lang.String command) |
protected Response |
execute(java.lang.String driverCommand,
java.util.Map<java.lang.String,?> parameters) |
java.lang.Object |
executeAsyncScript(java.lang.String script,
java.lang.Object... args) |
java.lang.Object |
executeScript(java.lang.String script,
java.lang.Object... args) |
org.openqa.selenium.WebElement |
findElement(org.openqa.selenium.By by) |
protected org.openqa.selenium.WebElement |
findElement(java.lang.String by,
java.lang.String using) |
org.openqa.selenium.WebElement |
findElementByClassName(java.lang.String using) |
org.openqa.selenium.WebElement |
findElementByCssSelector(java.lang.String using) |
org.openqa.selenium.WebElement |
findElementById(java.lang.String using) |
org.openqa.selenium.WebElement |
findElementByLinkText(java.lang.String using) |
org.openqa.selenium.WebElement |
findElementByName(java.lang.String using) |
org.openqa.selenium.WebElement |
findElementByPartialLinkText(java.lang.String using) |
org.openqa.selenium.WebElement |
findElementByTagName(java.lang.String using) |
org.openqa.selenium.WebElement |
findElementByXPath(java.lang.String using) |
java.util.List<org.openqa.selenium.WebElement> |
findElements(org.openqa.selenium.By by) |
protected java.util.List<org.openqa.selenium.WebElement> |
findElements(java.lang.String by,
java.lang.String using) |
java.util.List<org.openqa.selenium.WebElement> |
findElementsByClassName(java.lang.String using) |
java.util.List<org.openqa.selenium.WebElement> |
findElementsByCssSelector(java.lang.String using) |
java.util.List<org.openqa.selenium.WebElement> |
findElementsById(java.lang.String using) |
java.util.List<org.openqa.selenium.WebElement> |
findElementsByLinkText(java.lang.String using) |
java.util.List<org.openqa.selenium.WebElement> |
findElementsByName(java.lang.String using) |
java.util.List<org.openqa.selenium.WebElement> |
findElementsByPartialLinkText(java.lang.String using) |
java.util.List<org.openqa.selenium.WebElement> |
findElementsByTagName(java.lang.String using) |
java.util.List<org.openqa.selenium.WebElement> |
findElementsByXPath(java.lang.String using) |
void |
get(java.lang.String url) |
org.openqa.selenium.Capabilities |
getCapabilities() |
CommandExecutor |
getCommandExecutor() |
java.lang.String |
getCurrentUrl() |
protected JsonToWebElementConverter |
getElementConverter() |
ErrorHandler |
getErrorHandler() |
protected ExecuteMethod |
getExecuteMethod() |
FileDetector |
getFileDetector() |
org.openqa.selenium.interactions.Keyboard |
getKeyboard() |
org.openqa.selenium.interactions.Mouse |
getMouse() |
java.lang.String |
getPageSource() |
<X> X |
getScreenshotAs(org.openqa.selenium.OutputType<X> outputType) |
SessionId |
getSessionId() |
java.lang.String |
getTitle() |
int |
getW3CStandardComplianceLevel() |
java.lang.String |
getWindowHandle() |
java.util.Set<java.lang.String> |
getWindowHandles() |
private void |
init(org.openqa.selenium.Capabilities desiredCapabilities,
org.openqa.selenium.Capabilities requiredCapabilities) |
private boolean |
isJavascriptEnabled() |
protected void |
log(SessionId sessionId,
java.lang.String commandName,
java.lang.Object toLog,
RemoteWebDriver.When when)
Override this to be notified at key points in the execution of a command.
|
org.openqa.selenium.WebDriver.Options |
manage() |
org.openqa.selenium.WebDriver.Navigation |
navigate() |
void |
quit() |
protected void |
setCommandExecutor(CommandExecutor executor) |
protected void |
setElementConverter(JsonToWebElementConverter converter) |
void |
setErrorHandler(ErrorHandler handler) |
void |
setFileDetector(FileDetector detector)
Set the file detector to be used when sending keyboard input.
|
protected void |
setFoundBy(org.openqa.selenium.SearchContext context,
org.openqa.selenium.WebElement element,
java.lang.String by,
java.lang.String using) |
void |
setLogLevel(java.util.logging.Level level)
Sets the RemoteWebDriver's client log level.
|
protected void |
setSessionId(java.lang.String opaqueKey) |
protected void |
startClient()
Method called before
starting a new session . |
protected void |
startClient(org.openqa.selenium.Capabilities desiredCapabilities,
org.openqa.selenium.Capabilities requiredCapabilities)
Method called before
starting a new session . |
protected void |
startSession(org.openqa.selenium.Capabilities desiredCapabilities) |
protected void |
startSession(org.openqa.selenium.Capabilities desiredCapabilities,
org.openqa.selenium.Capabilities requiredCapabilities) |
protected void |
stopClient()
Method called after executing a
quit() command. |
protected void |
stopClient(org.openqa.selenium.Capabilities desiredCapabilities,
org.openqa.selenium.Capabilities requiredCapabilities)
Method called after executing a
quit() command. |
org.openqa.selenium.WebDriver.TargetLocator |
switchTo() |
java.lang.String |
toString() |
private static final java.util.logging.Logger logger
private java.util.logging.Level level
private ErrorHandler errorHandler
private CommandExecutor executor
private org.openqa.selenium.Capabilities capabilities
private SessionId sessionId
private FileDetector fileDetector
private ExecuteMethod executeMethod
private JsonToWebElementConverter converter
private RemoteKeyboard keyboard
private RemoteMouse mouse
private org.openqa.selenium.logging.Logs remoteLogs
private LocalLogs localLogs
private int w3cComplianceLevel
protected RemoteWebDriver()
public RemoteWebDriver(CommandExecutor executor, org.openqa.selenium.Capabilities desiredCapabilities, org.openqa.selenium.Capabilities requiredCapabilities)
public RemoteWebDriver(CommandExecutor executor, org.openqa.selenium.Capabilities desiredCapabilities)
public RemoteWebDriver(org.openqa.selenium.Capabilities desiredCapabilities)
public RemoteWebDriver(java.net.URL remoteAddress, org.openqa.selenium.Capabilities desiredCapabilities, org.openqa.selenium.Capabilities requiredCapabilities)
public RemoteWebDriver(java.net.URL remoteAddress, org.openqa.selenium.Capabilities desiredCapabilities)
public int getW3CStandardComplianceLevel()
private void init(org.openqa.selenium.Capabilities desiredCapabilities, org.openqa.selenium.Capabilities requiredCapabilities)
public void setFileDetector(FileDetector detector)
detector
- The detector to use. Must not be null.FileDetector
,
LocalFileDetector
,
UselessFileDetector
public SessionId getSessionId()
protected void setSessionId(java.lang.String opaqueKey)
protected void startSession(org.openqa.selenium.Capabilities desiredCapabilities)
protected void startSession(org.openqa.selenium.Capabilities desiredCapabilities, org.openqa.selenium.Capabilities requiredCapabilities)
protected void startClient()
starting a new session
. The default
implementation is a no-op, but subtypes should override this method to define custom behavior.protected void startClient(org.openqa.selenium.Capabilities desiredCapabilities, org.openqa.selenium.Capabilities requiredCapabilities)
starting a new session
. The default
implementation is a no-op, but subtypes should override this method to define custom behavior.protected void stopClient()
quit()
command. The default implementation is a no-op,
but subtypes should override this method to define custom behavior.protected void stopClient(org.openqa.selenium.Capabilities desiredCapabilities, org.openqa.selenium.Capabilities requiredCapabilities)
quit()
command. The default implementation is a no-op,
but subtypes should override this method to define custom behavior.public ErrorHandler getErrorHandler()
public void setErrorHandler(ErrorHandler handler)
public CommandExecutor getCommandExecutor()
protected void setCommandExecutor(CommandExecutor executor)
public org.openqa.selenium.Capabilities getCapabilities()
getCapabilities
in interface org.openqa.selenium.HasCapabilities
public void get(java.lang.String url)
get
in interface org.openqa.selenium.WebDriver
public java.lang.String getTitle()
getTitle
in interface org.openqa.selenium.WebDriver
public java.lang.String getCurrentUrl()
getCurrentUrl
in interface org.openqa.selenium.WebDriver
public <X> X getScreenshotAs(org.openqa.selenium.OutputType<X> outputType) throws org.openqa.selenium.WebDriverException
getScreenshotAs
in interface org.openqa.selenium.TakesScreenshot
org.openqa.selenium.WebDriverException
public java.util.List<org.openqa.selenium.WebElement> findElements(org.openqa.selenium.By by)
findElements
in interface org.openqa.selenium.SearchContext
findElements
in interface org.openqa.selenium.WebDriver
public org.openqa.selenium.WebElement findElement(org.openqa.selenium.By by)
findElement
in interface org.openqa.selenium.SearchContext
findElement
in interface org.openqa.selenium.WebDriver
protected org.openqa.selenium.WebElement findElement(java.lang.String by, java.lang.String using)
protected void setFoundBy(org.openqa.selenium.SearchContext context, org.openqa.selenium.WebElement element, java.lang.String by, java.lang.String using)
protected java.util.List<org.openqa.selenium.WebElement> findElements(java.lang.String by, java.lang.String using)
static java.lang.String cssEscape(java.lang.String using)
public org.openqa.selenium.WebElement findElementById(java.lang.String using)
findElementById
in interface org.openqa.selenium.internal.FindsById
public java.util.List<org.openqa.selenium.WebElement> findElementsById(java.lang.String using)
findElementsById
in interface org.openqa.selenium.internal.FindsById
public org.openqa.selenium.WebElement findElementByLinkText(java.lang.String using)
findElementByLinkText
in interface org.openqa.selenium.internal.FindsByLinkText
public java.util.List<org.openqa.selenium.WebElement> findElementsByLinkText(java.lang.String using)
findElementsByLinkText
in interface org.openqa.selenium.internal.FindsByLinkText
public org.openqa.selenium.WebElement findElementByPartialLinkText(java.lang.String using)
findElementByPartialLinkText
in interface org.openqa.selenium.internal.FindsByLinkText
public java.util.List<org.openqa.selenium.WebElement> findElementsByPartialLinkText(java.lang.String using)
findElementsByPartialLinkText
in interface org.openqa.selenium.internal.FindsByLinkText
public org.openqa.selenium.WebElement findElementByTagName(java.lang.String using)
findElementByTagName
in interface org.openqa.selenium.internal.FindsByTagName
public java.util.List<org.openqa.selenium.WebElement> findElementsByTagName(java.lang.String using)
findElementsByTagName
in interface org.openqa.selenium.internal.FindsByTagName
public org.openqa.selenium.WebElement findElementByName(java.lang.String using)
findElementByName
in interface org.openqa.selenium.internal.FindsByName
public java.util.List<org.openqa.selenium.WebElement> findElementsByName(java.lang.String using)
findElementsByName
in interface org.openqa.selenium.internal.FindsByName
public org.openqa.selenium.WebElement findElementByClassName(java.lang.String using)
findElementByClassName
in interface org.openqa.selenium.internal.FindsByClassName
public java.util.List<org.openqa.selenium.WebElement> findElementsByClassName(java.lang.String using)
findElementsByClassName
in interface org.openqa.selenium.internal.FindsByClassName
public org.openqa.selenium.WebElement findElementByCssSelector(java.lang.String using)
findElementByCssSelector
in interface org.openqa.selenium.internal.FindsByCssSelector
public java.util.List<org.openqa.selenium.WebElement> findElementsByCssSelector(java.lang.String using)
findElementsByCssSelector
in interface org.openqa.selenium.internal.FindsByCssSelector
public org.openqa.selenium.WebElement findElementByXPath(java.lang.String using)
findElementByXPath
in interface org.openqa.selenium.internal.FindsByXPath
public java.util.List<org.openqa.selenium.WebElement> findElementsByXPath(java.lang.String using)
findElementsByXPath
in interface org.openqa.selenium.internal.FindsByXPath
public java.lang.String getPageSource()
getPageSource
in interface org.openqa.selenium.WebDriver
public void close()
close
in interface org.openqa.selenium.WebDriver
public void quit()
quit
in interface org.openqa.selenium.WebDriver
public java.util.Set<java.lang.String> getWindowHandles()
getWindowHandles
in interface org.openqa.selenium.WebDriver
public java.lang.String getWindowHandle()
getWindowHandle
in interface org.openqa.selenium.WebDriver
public java.lang.Object executeScript(java.lang.String script, java.lang.Object... args)
executeScript
in interface org.openqa.selenium.JavascriptExecutor
public java.lang.Object executeAsyncScript(java.lang.String script, java.lang.Object... args)
executeAsyncScript
in interface org.openqa.selenium.JavascriptExecutor
private boolean isJavascriptEnabled()
public org.openqa.selenium.WebDriver.TargetLocator switchTo()
switchTo
in interface org.openqa.selenium.WebDriver
public org.openqa.selenium.WebDriver.Navigation navigate()
navigate
in interface org.openqa.selenium.WebDriver
public org.openqa.selenium.WebDriver.Options manage()
manage
in interface org.openqa.selenium.WebDriver
protected void setElementConverter(JsonToWebElementConverter converter)
protected JsonToWebElementConverter getElementConverter()
public void setLogLevel(java.util.logging.Level level)
level
- The log level to use.protected Response execute(java.lang.String driverCommand, java.util.Map<java.lang.String,?> parameters)
protected Response execute(java.lang.String command)
protected ExecuteMethod getExecuteMethod()
public org.openqa.selenium.interactions.Keyboard getKeyboard()
getKeyboard
in interface org.openqa.selenium.interactions.HasInputDevices
public org.openqa.selenium.interactions.Mouse getMouse()
getMouse
in interface org.openqa.selenium.interactions.HasInputDevices
protected void log(SessionId sessionId, java.lang.String commandName, java.lang.Object toLog, RemoteWebDriver.When when)
sessionId
- the session id.commandName
- the command that is being executed.toLog
- any data that might be interesting.when
- verb tense of "Execute" to prefix messagepublic FileDetector getFileDetector()
public java.lang.String toString()
toString
in class java.lang.Object