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
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(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()
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)
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 static void setLogLevel(Level level)
- Sets the RemoteWebDriver's client log level. Logs at a level lower than the
given level will be discarded.
- Parameters:
level
-
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()
Copyright © 2012. All Rights Reserved.