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 Object
- implements WebDriver, JavascriptExecutor, FindsById, FindsByClassName, FindsByLinkText, FindsByName, FindsByCssSelector, FindsByTagName, FindsByXPath, HasInputDevices, HasCapabilities
Method Summary |
void |
close()
|
protected Response |
execute(String command)
|
protected Response |
execute(String driverCommand,
Map<String,?> parameters)
|
Object |
executeAsyncScript(String script,
Object... args)
|
Object |
executeScript(String script,
Object... args)
|
WebElement |
findElement(By by)
|
protected WebElement |
findElement(String by,
String using)
|
WebElement |
findElementByClassName(String using)
|
WebElement |
findElementByCssSelector(String using)
|
WebElement |
findElementById(String using)
|
WebElement |
findElementByLinkText(String using)
|
WebElement |
findElementByName(String using)
|
WebElement |
findElementByPartialLinkText(String using)
|
WebElement |
findElementByTagName(String using)
|
WebElement |
findElementByXPath(String using)
|
List<WebElement> |
findElements(By by)
|
protected List<WebElement> |
findElements(String by,
String using)
|
List<WebElement> |
findElementsByClassName(String using)
|
List<WebElement> |
findElementsByCssSelector(String using)
|
List<WebElement> |
findElementsById(String using)
|
List<WebElement> |
findElementsByLinkText(String using)
|
List<WebElement> |
findElementsByName(String using)
|
List<WebElement> |
findElementsByPartialLinkText(String using)
|
List<WebElement> |
findElementsByTagName(String using)
|
List<WebElement> |
findElementsByXPath(String using)
|
void |
get(String url)
|
Capabilities |
getCapabilities()
|
CommandExecutor |
getCommandExecutor()
|
String |
getCurrentUrl()
|
protected JsonToWebElementConverter |
getElementConverter()
|
ErrorHandler |
getErrorHandler()
|
protected ExecuteMethod |
getExecuteMethod()
|
FileDetector |
getFileDetector()
|
Keyboard |
getKeyboard()
|
Mouse |
getMouse()
|
String |
getPageSource()
|
SessionId |
getSessionId()
|
String |
getTitle()
|
String |
getWindowHandle()
|
Set<String> |
getWindowHandles()
|
protected void |
log(SessionId sessionId,
String commandName,
Object toLog,
RemoteWebDriver.When when)
Override this to be notified at key points in the execution of a command. |
WebDriver.Options |
manage()
|
WebDriver.Navigation |
navigate()
|
void |
quit()
|
protected void |
setCommandExecutor(CommandExecutor executor)
|
protected void |
setElementConverter(JsonToWebElementConverter converter)
|
void |
setFileDetector(FileDetector detector)
Set the file detector to be used when sending keyboard input. |
protected void |
setFoundBy(SearchContext context,
WebElement element,
String by,
String using)
|
void |
setLogLevel(Level level)
Sets the RemoteWebDriver's client log level. |
protected void |
setSessionId(String opaqueKey)
|
protected void |
startClient()
Method called before starting a new session . |
protected void |
startSession(Capabilities desiredCapabilities)
|
protected void |
stopClient()
Method called after executing a quit() command. |
WebDriver.TargetLocator |
switchTo()
|
String |
toString()
|
RemoteWebDriver
protected RemoteWebDriver()
RemoteWebDriver
public RemoteWebDriver(CommandExecutor executor,
Capabilities desiredCapabilities)
RemoteWebDriver
public RemoteWebDriver(Capabilities desiredCapabilities)
RemoteWebDriver
public RemoteWebDriver(URL remoteAddress,
Capabilities desiredCapabilities)
setFileDetector
public void setFileDetector(FileDetector detector)
- Set the file detector to be used when sending keyboard input. By default, this is set to a file
detector that does nothing.
- Parameters:
detector
- The detector to use. Must not be null.- See Also:
FileDetector
,
LocalFileDetector
,
UselessFileDetector
getSessionId
public SessionId getSessionId()
setSessionId
protected void setSessionId(String opaqueKey)
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(String url)
- Specified by:
get
in interface WebDriver
getTitle
public String getTitle()
- Specified by:
getTitle
in interface WebDriver
getCurrentUrl
public String getCurrentUrl()
- Specified by:
getCurrentUrl
in interface WebDriver
findElements
public 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(String by,
String using)
setFoundBy
protected void setFoundBy(SearchContext context,
WebElement element,
String by,
String using)
findElements
protected List<WebElement> findElements(String by,
String using)
findElementById
public WebElement findElementById(String using)
- Specified by:
findElementById
in interface FindsById
findElementsById
public List<WebElement> findElementsById(String using)
- Specified by:
findElementsById
in interface FindsById
findElementByLinkText
public WebElement findElementByLinkText(String using)
- Specified by:
findElementByLinkText
in interface FindsByLinkText
findElementsByLinkText
public List<WebElement> findElementsByLinkText(String using)
- Specified by:
findElementsByLinkText
in interface FindsByLinkText
findElementByPartialLinkText
public WebElement findElementByPartialLinkText(String using)
- Specified by:
findElementByPartialLinkText
in interface FindsByLinkText
findElementsByPartialLinkText
public List<WebElement> findElementsByPartialLinkText(String using)
- Specified by:
findElementsByPartialLinkText
in interface FindsByLinkText
findElementByTagName
public WebElement findElementByTagName(String using)
- Specified by:
findElementByTagName
in interface FindsByTagName
findElementsByTagName
public List<WebElement> findElementsByTagName(String using)
- Specified by:
findElementsByTagName
in interface FindsByTagName
findElementByName
public WebElement findElementByName(String using)
- Specified by:
findElementByName
in interface FindsByName
findElementsByName
public List<WebElement> findElementsByName(String using)
- Specified by:
findElementsByName
in interface FindsByName
findElementByClassName
public WebElement findElementByClassName(String using)
- Specified by:
findElementByClassName
in interface FindsByClassName
findElementsByClassName
public List<WebElement> findElementsByClassName(String using)
- Specified by:
findElementsByClassName
in interface FindsByClassName
findElementByCssSelector
public WebElement findElementByCssSelector(String using)
- Specified by:
findElementByCssSelector
in interface FindsByCssSelector
findElementsByCssSelector
public List<WebElement> findElementsByCssSelector(String using)
- Specified by:
findElementsByCssSelector
in interface FindsByCssSelector
findElementByXPath
public WebElement findElementByXPath(String using)
- Specified by:
findElementByXPath
in interface FindsByXPath
findElementsByXPath
public List<WebElement> findElementsByXPath(String using)
- Specified by:
findElementsByXPath
in interface FindsByXPath
getPageSource
public 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 Set<String> getWindowHandles()
- Specified by:
getWindowHandles
in interface WebDriver
getWindowHandle
public String getWindowHandle()
- Specified by:
getWindowHandle
in interface WebDriver
executeScript
public Object executeScript(String script,
Object... args)
- Specified by:
executeScript
in interface JavascriptExecutor
executeAsyncScript
public Object executeAsyncScript(String script,
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
setElementConverter
protected void setElementConverter(JsonToWebElementConverter converter)
getElementConverter
protected JsonToWebElementConverter getElementConverter()
setLogLevel
public void setLogLevel(Level level)
- Sets the RemoteWebDriver's client log level.
- Parameters:
level
- The log level to use.
execute
protected Response execute(String driverCommand,
Map<String,?> parameters)
execute
protected Response execute(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,
String commandName,
Object toLog,
RemoteWebDriver.When when)
- 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.
getFileDetector
public FileDetector getFileDetector()
toString
public String toString()
- Overrides:
toString
in class Object
Copyright © 2012. All Rights Reserved.