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.interactions.Interactive, org.openqa.selenium.TakesScreenshot
Modifier and Type | Class and Description |
---|---|
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 | Constructor and Description |
---|---|
protected |
RemoteWebDriver() |
|
RemoteWebDriver(org.openqa.selenium.Capabilities capabilities) |
|
RemoteWebDriver(CommandExecutor executor,
org.openqa.selenium.Capabilities capabilities) |
|
RemoteWebDriver(java.net.URL remoteAddress,
org.openqa.selenium.Capabilities capabilities) |
Modifier and Type | Method and Description |
---|---|
void |
close() |
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() |
java.lang.String |
getWindowHandle() |
java.util.Set<java.lang.String> |
getWindowHandles() |
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 |
perform(java.util.Collection<org.openqa.selenium.interactions.Sequence> actions) |
void |
quit() |
void |
resetInputState() |
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()
Deprecated.
No longer used, as behaviour is now in
CommandExecutor instances. |
protected void |
startClient(org.openqa.selenium.Capabilities capabilities)
Deprecated.
No longer used, as behaviour is now in
CommandExecutor instances. |
protected void |
startSession(org.openqa.selenium.Capabilities capabilities) |
protected void |
stopClient()
Deprecated.
No longer used, as behaviour is now in
CommandExecutor instances. |
protected void |
stopClient(org.openqa.selenium.Capabilities capabilities)
Deprecated.
No longer used, as behaviour is now in
CommandExecutor instances. |
org.openqa.selenium.WebDriver.TargetLocator |
switchTo() |
java.lang.String |
toString() |
protected RemoteWebDriver()
public RemoteWebDriver(org.openqa.selenium.Capabilities capabilities)
public RemoteWebDriver(CommandExecutor executor, org.openqa.selenium.Capabilities capabilities)
public RemoteWebDriver(java.net.URL remoteAddress, org.openqa.selenium.Capabilities capabilities)
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 capabilities)
@Deprecated protected void startClient()
CommandExecutor
instances.starting a new session
. The default
implementation is a no-op, but subtypes should override this method to define custom behavior.@Deprecated protected void startClient(org.openqa.selenium.Capabilities capabilities)
CommandExecutor
instances.starting a new session
. The default
implementation is a no-op, but subtypes should override this method to define custom behavior.@Deprecated protected void stopClient()
CommandExecutor
instances.quit()
command. The default implementation is a no-op,
but subtypes should override this method to define custom behavior.@Deprecated protected void stopClient(org.openqa.selenium.Capabilities capabilities)
CommandExecutor
instances.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)
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
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 void perform(java.util.Collection<org.openqa.selenium.interactions.Sequence> actions)
perform
in interface org.openqa.selenium.interactions.Interactive
public void resetInputState()
resetInputState
in interface org.openqa.selenium.interactions.Interactive
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