org.openqa.selenium.remote
Class RemoteWebDriver
java.lang.Object
org.openqa.selenium.remote.RemoteWebDriver
- All Implemented Interfaces:
- HasCapabilities, HasInputDevices, FindsByClassName, FindsByCssSelector, FindsById, FindsByLinkText, FindsByName, FindsByTagName, FindsByXPath, JavascriptExecutor, SearchContext, WebDriver
public class RemoteWebDriver
- extends java.lang.Object
- implements WebDriver, JavascriptExecutor, FindsById, FindsByClassName, FindsByLinkText, FindsByName, FindsByCssSelector, FindsByTagName, FindsByXPath, HasInputDevices, HasCapabilities
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
RemoteWebDriver
protected RemoteWebDriver()
RemoteWebDriver
public RemoteWebDriver(CommandExecutor executor,
Capabilities desiredCapabilities)
RemoteWebDriver
public RemoteWebDriver(Capabilities desiredCapabilities)
RemoteWebDriver
public RemoteWebDriver(java.net.URL remoteAddress,
Capabilities desiredCapabilities)
getSessionId
public SessionId getSessionId()
startSession
protected void startSession(Capabilities desiredCapabilities)
startClient
protected void startClient()
- Method called before
starting a new session
. The default
implementation is a no-op, but subtypes should override this method to
define custom behavior.
stopClient
protected void stopClient()
- Method called after executing a
quit()
command. Subtypes
getErrorHandler
public ErrorHandler getErrorHandler()
getCommandExecutor
public CommandExecutor getCommandExecutor()
setCommandExecutor
protected void setCommandExecutor(CommandExecutor executor)
getCapabilities
public Capabilities getCapabilities()
- Specified by:
getCapabilities
in interface HasCapabilities
get
public void get(java.lang.String url)
- Specified by:
get
in interface WebDriver
getTitle
public java.lang.String getTitle()
- Specified by:
getTitle
in interface WebDriver
getCurrentUrl
public java.lang.String getCurrentUrl()
- Specified by:
getCurrentUrl
in interface WebDriver
findElements
public java.util.List<WebElement> findElements(By by)
- Specified by:
findElements
in interface SearchContext
- Specified by:
findElements
in interface WebDriver
findElement
public WebElement findElement(By by)
- Specified by:
findElement
in interface SearchContext
- Specified by:
findElement
in interface WebDriver
findElement
protected WebElement findElement(java.lang.String by,
java.lang.String using)
findElements
protected java.util.List<WebElement> findElements(java.lang.String by,
java.lang.String using)
findElementById
public WebElement findElementById(java.lang.String using)
- Specified by:
findElementById
in interface FindsById
findElementsById
public java.util.List<WebElement> findElementsById(java.lang.String using)
- Specified by:
findElementsById
in interface FindsById
findElementByLinkText
public WebElement findElementByLinkText(java.lang.String using)
- Specified by:
findElementByLinkText
in interface FindsByLinkText
findElementsByLinkText
public java.util.List<WebElement> findElementsByLinkText(java.lang.String using)
- Specified by:
findElementsByLinkText
in interface FindsByLinkText
findElementByPartialLinkText
public WebElement findElementByPartialLinkText(java.lang.String using)
- Specified by:
findElementByPartialLinkText
in interface FindsByLinkText
findElementsByPartialLinkText
public java.util.List<WebElement> findElementsByPartialLinkText(java.lang.String using)
- Specified by:
findElementsByPartialLinkText
in interface FindsByLinkText
findElementByTagName
public WebElement findElementByTagName(java.lang.String using)
- Specified by:
findElementByTagName
in interface FindsByTagName
findElementsByTagName
public java.util.List<WebElement> findElementsByTagName(java.lang.String using)
- Specified by:
findElementsByTagName
in interface FindsByTagName
findElementByName
public WebElement findElementByName(java.lang.String using)
- Specified by:
findElementByName
in interface FindsByName
findElementsByName
public java.util.List<WebElement> findElementsByName(java.lang.String using)
- Specified by:
findElementsByName
in interface FindsByName
findElementByClassName
public WebElement findElementByClassName(java.lang.String using)
- Specified by:
findElementByClassName
in interface FindsByClassName
findElementsByClassName
public java.util.List<WebElement> findElementsByClassName(java.lang.String using)
- Specified by:
findElementsByClassName
in interface FindsByClassName
findElementByCssSelector
public WebElement findElementByCssSelector(java.lang.String using)
- Specified by:
findElementByCssSelector
in interface FindsByCssSelector
findElementsByCssSelector
public java.util.List<WebElement> findElementsByCssSelector(java.lang.String using)
- Specified by:
findElementsByCssSelector
in interface FindsByCssSelector
findElementByXPath
public WebElement findElementByXPath(java.lang.String using)
- Specified by:
findElementByXPath
in interface FindsByXPath
findElementsByXPath
public java.util.List<WebElement> findElementsByXPath(java.lang.String using)
- Specified by:
findElementsByXPath
in interface FindsByXPath
getPageSource
public java.lang.String getPageSource()
- Specified by:
getPageSource
in interface WebDriver
close
public void close()
- Specified by:
close
in interface WebDriver
quit
public void quit()
- Specified by:
quit
in interface WebDriver
getWindowHandles
public java.util.Set<java.lang.String> getWindowHandles()
- Specified by:
getWindowHandles
in interface WebDriver
getWindowHandle
public java.lang.String getWindowHandle()
- Specified by:
getWindowHandle
in interface WebDriver
executeScript
public java.lang.Object executeScript(java.lang.String script,
java.lang.Object... args)
- Specified by:
executeScript
in interface JavascriptExecutor
executeAsyncScript
public java.lang.Object executeAsyncScript(java.lang.String script,
java.lang.Object... args)
- Specified by:
executeAsyncScript
in interface JavascriptExecutor
switchTo
public WebDriver.TargetLocator switchTo()
- Specified by:
switchTo
in interface WebDriver
navigate
public WebDriver.Navigation navigate()
- Specified by:
navigate
in interface WebDriver
manage
public WebDriver.Options manage()
- Specified by:
manage
in interface WebDriver
newRemoteWebElement
@Deprecated
protected RemoteWebElement newRemoteWebElement()
- Deprecated.
- Creates a new
RemoteWebElement
that is a child of this instance.
Subtypes should override this method to customize the type of
RemoteWebElement returned.
- Returns:
- A new RemoteWebElement that is a child of this instance.
setElementConverter
protected void setElementConverter(JsonToWebElementConverter converter)
getElementConverter
protected JsonToWebElementConverter getElementConverter()
execute
protected Response execute(java.lang.String driverCommand,
java.util.Map<java.lang.String,?> parameters)
execute
protected Response execute(java.lang.String command)
getExecuteMethod
protected ExecuteMethod getExecuteMethod()
getKeyboard
public Keyboard getKeyboard()
- Specified by:
getKeyboard
in interface HasInputDevices
getMouse
public Mouse getMouse()
- Specified by:
getMouse
in interface HasInputDevices
log
protected void log(SessionId sessionId,
java.lang.String commandName,
java.lang.Object toLog)
- Override this to be notified at key points in the execution of a command.
- Parameters:
sessionId
- the session id.commandName
- the command that is being executed.toLog
- any data that might be interesting.
Copyright © 2011. All Rights Reserved.