Package org.openqa.selenium.remote
Class RemoteWebDriver
- java.lang.Object
-
- org.openqa.selenium.remote.RemoteWebDriver
-
- All Implemented Interfaces:
org.openqa.selenium.HasCapabilities,org.openqa.selenium.interactions.HasInputDevices,org.openqa.selenium.interactions.Interactive,org.openqa.selenium.internal.FindsByClassName,org.openqa.selenium.internal.FindsByCssSelector,org.openqa.selenium.internal.FindsById,org.openqa.selenium.internal.FindsByLinkText,org.openqa.selenium.internal.FindsByName,org.openqa.selenium.internal.FindsByTagName,org.openqa.selenium.internal.FindsByXPath,org.openqa.selenium.JavascriptExecutor,org.openqa.selenium.SearchContext,org.openqa.selenium.TakesScreenshot,org.openqa.selenium.virtualauthenticator.HasVirtualAuthenticator,org.openqa.selenium.WebDriver
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, org.openqa.selenium.virtualauthenticator.HasVirtualAuthenticator
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected classRemoteWebDriver.RemoteTargetLocatorprotected classRemoteWebDriver.RemoteWebDriverOptionsstatic classRemoteWebDriver.When-
Nested classes/interfaces inherited from interface org.openqa.selenium.WebDriver
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
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedRemoteWebDriver()RemoteWebDriver(java.net.URL remoteAddress, org.openqa.selenium.Capabilities capabilities)RemoteWebDriver(org.openqa.selenium.Capabilities capabilities)RemoteWebDriver(CommandExecutor executor, org.openqa.selenium.Capabilities capabilities)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description org.openqa.selenium.virtualauthenticator.VirtualAuthenticatoraddVirtualAuthenticator(org.openqa.selenium.virtualauthenticator.VirtualAuthenticatorOptions options)static RemoteWebDriverBuilderbuilder()voidclose()protected Responseexecute(java.lang.String command)protected Responseexecute(java.lang.String driverCommand, java.util.Map<java.lang.String,?> parameters)protected Responseexecute(CommandPayload payload)java.lang.ObjectexecuteAsyncScript(java.lang.String script, java.lang.Object... args)java.lang.ObjectexecuteScript(java.lang.String script, java.lang.Object... args)protected org.openqa.selenium.WebElementfindElement(java.lang.String by, java.lang.String using)org.openqa.selenium.WebElementfindElement(org.openqa.selenium.By by)org.openqa.selenium.WebElementfindElementByClassName(java.lang.String using)org.openqa.selenium.WebElementfindElementByCssSelector(java.lang.String using)org.openqa.selenium.WebElementfindElementById(java.lang.String using)org.openqa.selenium.WebElementfindElementByLinkText(java.lang.String using)org.openqa.selenium.WebElementfindElementByName(java.lang.String using)org.openqa.selenium.WebElementfindElementByPartialLinkText(java.lang.String using)org.openqa.selenium.WebElementfindElementByTagName(java.lang.String using)org.openqa.selenium.WebElementfindElementByXPath(java.lang.String using)protected java.util.List<org.openqa.selenium.WebElement>findElements(java.lang.String by, java.lang.String using)java.util.List<org.openqa.selenium.WebElement>findElements(org.openqa.selenium.By by)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)voidget(java.lang.String url)org.openqa.selenium.CapabilitiesgetCapabilities()CommandExecutorgetCommandExecutor()java.lang.StringgetCurrentUrl()protected JsonToWebElementConvertergetElementConverter()ErrorHandlergetErrorHandler()protected ExecuteMethodgetExecuteMethod()FileDetectorgetFileDetector()org.openqa.selenium.interactions.KeyboardgetKeyboard()org.openqa.selenium.interactions.MousegetMouse()java.lang.StringgetPageSource()<X> XgetScreenshotAs(org.openqa.selenium.OutputType<X> outputType)SessionIdgetSessionId()java.lang.StringgetTitle()java.lang.StringgetWindowHandle()java.util.Set<java.lang.String>getWindowHandles()protected voidlog(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.Optionsmanage()org.openqa.selenium.WebDriver.Navigationnavigate()voidperform(java.util.Collection<org.openqa.selenium.interactions.Sequence> actions)voidquit()voidremoveVirtualAuthenticator(org.openqa.selenium.virtualauthenticator.VirtualAuthenticator authenticator)voidresetInputState()protected voidsetCommandExecutor(CommandExecutor executor)protected voidsetElementConverter(JsonToWebElementConverter converter)voidsetErrorHandler(ErrorHandler handler)voidsetFileDetector(FileDetector detector)Set the file detector to be used when sending keyboard input.protected voidsetFoundBy(org.openqa.selenium.SearchContext context, org.openqa.selenium.WebElement element, java.lang.String by, java.lang.String using)voidsetLogLevel(java.util.logging.Level level)Sets the RemoteWebDriver's client log level.protected voidsetSessionId(java.lang.String opaqueKey)protected voidstartSession(org.openqa.selenium.Capabilities capabilities)org.openqa.selenium.WebDriver.TargetLocatorswitchTo()java.lang.StringtoString()
-
-
-
Constructor Detail
-
RemoteWebDriver
protected RemoteWebDriver()
-
RemoteWebDriver
public RemoteWebDriver(org.openqa.selenium.Capabilities capabilities)
-
RemoteWebDriver
public RemoteWebDriver(CommandExecutor executor, org.openqa.selenium.Capabilities capabilities)
-
RemoteWebDriver
public RemoteWebDriver(java.net.URL remoteAddress, org.openqa.selenium.Capabilities capabilities)
-
-
Method Detail
-
builder
@Beta public static RemoteWebDriverBuilder builder()
-
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(java.lang.String opaqueKey)
-
startSession
protected void startSession(org.openqa.selenium.Capabilities capabilities)
-
getErrorHandler
public ErrorHandler getErrorHandler()
-
setErrorHandler
public void setErrorHandler(ErrorHandler handler)
-
getCommandExecutor
public CommandExecutor getCommandExecutor()
-
setCommandExecutor
protected void setCommandExecutor(CommandExecutor executor)
-
getCapabilities
public org.openqa.selenium.Capabilities getCapabilities()
- Specified by:
getCapabilitiesin interfaceorg.openqa.selenium.HasCapabilities
-
get
public void get(java.lang.String url)
- Specified by:
getin interfaceorg.openqa.selenium.WebDriver
-
getTitle
public java.lang.String getTitle()
- Specified by:
getTitlein interfaceorg.openqa.selenium.WebDriver
-
getCurrentUrl
public java.lang.String getCurrentUrl()
- Specified by:
getCurrentUrlin interfaceorg.openqa.selenium.WebDriver
-
getScreenshotAs
public <X> X getScreenshotAs(org.openqa.selenium.OutputType<X> outputType) throws org.openqa.selenium.WebDriverException- Specified by:
getScreenshotAsin interfaceorg.openqa.selenium.TakesScreenshot- Throws:
org.openqa.selenium.WebDriverException
-
findElements
public java.util.List<org.openqa.selenium.WebElement> findElements(org.openqa.selenium.By by)
- Specified by:
findElementsin interfaceorg.openqa.selenium.SearchContext- Specified by:
findElementsin interfaceorg.openqa.selenium.WebDriver
-
findElement
public org.openqa.selenium.WebElement findElement(org.openqa.selenium.By by)
- Specified by:
findElementin interfaceorg.openqa.selenium.SearchContext- Specified by:
findElementin interfaceorg.openqa.selenium.WebDriver
-
findElement
protected org.openqa.selenium.WebElement findElement(java.lang.String by, java.lang.String using)
-
setFoundBy
protected void setFoundBy(org.openqa.selenium.SearchContext context, org.openqa.selenium.WebElement element, java.lang.String by, java.lang.String using)
-
findElements
protected java.util.List<org.openqa.selenium.WebElement> findElements(java.lang.String by, java.lang.String using)
-
findElementById
public org.openqa.selenium.WebElement findElementById(java.lang.String using)
- Specified by:
findElementByIdin interfaceorg.openqa.selenium.internal.FindsById
-
findElementsById
public java.util.List<org.openqa.selenium.WebElement> findElementsById(java.lang.String using)
- Specified by:
findElementsByIdin interfaceorg.openqa.selenium.internal.FindsById
-
findElementByLinkText
public org.openqa.selenium.WebElement findElementByLinkText(java.lang.String using)
- Specified by:
findElementByLinkTextin interfaceorg.openqa.selenium.internal.FindsByLinkText
-
findElementsByLinkText
public java.util.List<org.openqa.selenium.WebElement> findElementsByLinkText(java.lang.String using)
- Specified by:
findElementsByLinkTextin interfaceorg.openqa.selenium.internal.FindsByLinkText
-
findElementByPartialLinkText
public org.openqa.selenium.WebElement findElementByPartialLinkText(java.lang.String using)
- Specified by:
findElementByPartialLinkTextin interfaceorg.openqa.selenium.internal.FindsByLinkText
-
findElementsByPartialLinkText
public java.util.List<org.openqa.selenium.WebElement> findElementsByPartialLinkText(java.lang.String using)
- Specified by:
findElementsByPartialLinkTextin interfaceorg.openqa.selenium.internal.FindsByLinkText
-
findElementByTagName
public org.openqa.selenium.WebElement findElementByTagName(java.lang.String using)
- Specified by:
findElementByTagNamein interfaceorg.openqa.selenium.internal.FindsByTagName
-
findElementsByTagName
public java.util.List<org.openqa.selenium.WebElement> findElementsByTagName(java.lang.String using)
- Specified by:
findElementsByTagNamein interfaceorg.openqa.selenium.internal.FindsByTagName
-
findElementByName
public org.openqa.selenium.WebElement findElementByName(java.lang.String using)
- Specified by:
findElementByNamein interfaceorg.openqa.selenium.internal.FindsByName
-
findElementsByName
public java.util.List<org.openqa.selenium.WebElement> findElementsByName(java.lang.String using)
- Specified by:
findElementsByNamein interfaceorg.openqa.selenium.internal.FindsByName
-
findElementByClassName
public org.openqa.selenium.WebElement findElementByClassName(java.lang.String using)
- Specified by:
findElementByClassNamein interfaceorg.openqa.selenium.internal.FindsByClassName
-
findElementsByClassName
public java.util.List<org.openqa.selenium.WebElement> findElementsByClassName(java.lang.String using)
- Specified by:
findElementsByClassNamein interfaceorg.openqa.selenium.internal.FindsByClassName
-
findElementByCssSelector
public org.openqa.selenium.WebElement findElementByCssSelector(java.lang.String using)
- Specified by:
findElementByCssSelectorin interfaceorg.openqa.selenium.internal.FindsByCssSelector
-
findElementsByCssSelector
public java.util.List<org.openqa.selenium.WebElement> findElementsByCssSelector(java.lang.String using)
- Specified by:
findElementsByCssSelectorin interfaceorg.openqa.selenium.internal.FindsByCssSelector
-
findElementByXPath
public org.openqa.selenium.WebElement findElementByXPath(java.lang.String using)
- Specified by:
findElementByXPathin interfaceorg.openqa.selenium.internal.FindsByXPath
-
findElementsByXPath
public java.util.List<org.openqa.selenium.WebElement> findElementsByXPath(java.lang.String using)
- Specified by:
findElementsByXPathin interfaceorg.openqa.selenium.internal.FindsByXPath
-
getPageSource
public java.lang.String getPageSource()
- Specified by:
getPageSourcein interfaceorg.openqa.selenium.WebDriver
-
close
public void close()
- Specified by:
closein interfaceorg.openqa.selenium.WebDriver
-
quit
public void quit()
- Specified by:
quitin interfaceorg.openqa.selenium.WebDriver
-
getWindowHandles
public java.util.Set<java.lang.String> getWindowHandles()
- Specified by:
getWindowHandlesin interfaceorg.openqa.selenium.WebDriver
-
getWindowHandle
public java.lang.String getWindowHandle()
- Specified by:
getWindowHandlein interfaceorg.openqa.selenium.WebDriver
-
executeScript
public java.lang.Object executeScript(java.lang.String script, java.lang.Object... args)- Specified by:
executeScriptin interfaceorg.openqa.selenium.JavascriptExecutor
-
executeAsyncScript
public java.lang.Object executeAsyncScript(java.lang.String script, java.lang.Object... args)- Specified by:
executeAsyncScriptin interfaceorg.openqa.selenium.JavascriptExecutor
-
switchTo
public org.openqa.selenium.WebDriver.TargetLocator switchTo()
- Specified by:
switchToin interfaceorg.openqa.selenium.WebDriver
-
navigate
public org.openqa.selenium.WebDriver.Navigation navigate()
- Specified by:
navigatein interfaceorg.openqa.selenium.WebDriver
-
manage
public org.openqa.selenium.WebDriver.Options manage()
- Specified by:
managein interfaceorg.openqa.selenium.WebDriver
-
setElementConverter
protected void setElementConverter(JsonToWebElementConverter converter)
-
getElementConverter
protected JsonToWebElementConverter getElementConverter()
-
setLogLevel
public void setLogLevel(java.util.logging.Level level)
Sets the RemoteWebDriver's client log level.- Parameters:
level- The log level to use.
-
execute
protected Response execute(CommandPayload payload)
-
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()
-
perform
public void perform(java.util.Collection<org.openqa.selenium.interactions.Sequence> actions)
- Specified by:
performin interfaceorg.openqa.selenium.interactions.Interactive
-
resetInputState
public void resetInputState()
- Specified by:
resetInputStatein interfaceorg.openqa.selenium.interactions.Interactive
-
getKeyboard
public org.openqa.selenium.interactions.Keyboard getKeyboard()
- Specified by:
getKeyboardin interfaceorg.openqa.selenium.interactions.HasInputDevices
-
getMouse
public org.openqa.selenium.interactions.Mouse getMouse()
- Specified by:
getMousein interfaceorg.openqa.selenium.interactions.HasInputDevices
-
addVirtualAuthenticator
public org.openqa.selenium.virtualauthenticator.VirtualAuthenticator addVirtualAuthenticator(org.openqa.selenium.virtualauthenticator.VirtualAuthenticatorOptions options)
- Specified by:
addVirtualAuthenticatorin interfaceorg.openqa.selenium.virtualauthenticator.HasVirtualAuthenticator
-
removeVirtualAuthenticator
public void removeVirtualAuthenticator(org.openqa.selenium.virtualauthenticator.VirtualAuthenticator authenticator)
- Specified by:
removeVirtualAuthenticatorin interfaceorg.openqa.selenium.virtualauthenticator.HasVirtualAuthenticator
-
log
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.- Parameters:
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 message
-
getFileDetector
public FileDetector getFileDetector()
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-