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.JavascriptExecutor
,org.openqa.selenium.PrintsPage
,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.interactions.HasInputDevices, org.openqa.selenium.HasCapabilities, org.openqa.selenium.virtualauthenticator.HasVirtualAuthenticator, org.openqa.selenium.interactions.Interactive, org.openqa.selenium.PrintsPage, org.openqa.selenium.TakesScreenshot
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected class
RemoteWebDriver.RemoteTargetLocator
protected class
RemoteWebDriver.RemoteWebDriverOptions
static class
RemoteWebDriver.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 protected
RemoteWebDriver()
RemoteWebDriver(java.net.URL remoteAddress, org.openqa.selenium.Capabilities capabilities)
RemoteWebDriver(java.net.URL remoteAddress, org.openqa.selenium.Capabilities capabilities, boolean enableTracing)
RemoteWebDriver(org.openqa.selenium.Capabilities capabilities)
RemoteWebDriver(org.openqa.selenium.Capabilities capabilities, boolean enableTracing)
RemoteWebDriver(CommandExecutor executor, org.openqa.selenium.Capabilities capabilities)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description org.openqa.selenium.virtualauthenticator.VirtualAuthenticator
addVirtualAuthenticator(org.openqa.selenium.virtualauthenticator.VirtualAuthenticatorOptions options)
static RemoteWebDriverBuilder
builder()
void
close()
protected Response
execute(java.lang.String command)
protected Response
execute(java.lang.String driverCommand, java.util.Map<java.lang.String,?> parameters)
protected Response
execute(CommandPayload payload)
java.lang.Object
executeAsyncScript(java.lang.String script, java.lang.Object... args)
java.lang.Object
executeScript(java.lang.String script, java.lang.Object... args)
protected org.openqa.selenium.WebElement
findElement(java.lang.String by, java.lang.String using)
Deprecated.Rely on usingBy.Remotable
insteadorg.openqa.selenium.WebElement
findElement(org.openqa.selenium.By locator)
protected java.util.List<org.openqa.selenium.WebElement>
findElements(java.lang.String by, java.lang.String using)
Deprecated.Rely on usingBy.Remotable
insteadjava.util.List<org.openqa.selenium.WebElement>
findElements(org.openqa.selenium.By locator)
java.util.List<org.openqa.selenium.WebElement>
findElements(org.openqa.selenium.SearchContext context, java.util.function.BiFunction<java.lang.String,java.lang.Object,CommandPayload> findCommand, org.openqa.selenium.By locator)
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)
org.openqa.selenium.Pdf
print(org.openqa.selenium.print.PrintOptions printOptions)
void
quit()
void
removeVirtualAuthenticator(org.openqa.selenium.virtualauthenticator.VirtualAuthenticator authenticator)
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
startSession(org.openqa.selenium.Capabilities capabilities)
org.openqa.selenium.WebDriver.TargetLocator
switchTo()
java.lang.String
toString()
-
-
-
Constructor Detail
-
RemoteWebDriver
protected RemoteWebDriver()
-
RemoteWebDriver
public RemoteWebDriver(org.openqa.selenium.Capabilities capabilities)
-
RemoteWebDriver
public RemoteWebDriver(org.openqa.selenium.Capabilities capabilities, boolean enableTracing)
-
RemoteWebDriver
public RemoteWebDriver(java.net.URL remoteAddress, org.openqa.selenium.Capabilities capabilities)
-
RemoteWebDriver
public RemoteWebDriver(java.net.URL remoteAddress, org.openqa.selenium.Capabilities capabilities, boolean enableTracing)
-
RemoteWebDriver
public RemoteWebDriver(CommandExecutor executor, org.openqa.selenium.Capabilities capabilities)
-
-
Method Detail
-
builder
@Beta public static RemoteWebDriverBuilder builder()
-
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:
getCapabilities
in interfaceorg.openqa.selenium.HasCapabilities
-
get
public void get(java.lang.String url)
- Specified by:
get
in interfaceorg.openqa.selenium.WebDriver
-
getTitle
public java.lang.String getTitle()
- Specified by:
getTitle
in interfaceorg.openqa.selenium.WebDriver
-
getCurrentUrl
public java.lang.String getCurrentUrl()
- Specified by:
getCurrentUrl
in interfaceorg.openqa.selenium.WebDriver
-
getScreenshotAs
public <X> X getScreenshotAs(org.openqa.selenium.OutputType<X> outputType) throws org.openqa.selenium.WebDriverException
- Specified by:
getScreenshotAs
in interfaceorg.openqa.selenium.TakesScreenshot
- Throws:
org.openqa.selenium.WebDriverException
-
print
public org.openqa.selenium.Pdf print(org.openqa.selenium.print.PrintOptions printOptions) throws org.openqa.selenium.WebDriverException
- Specified by:
print
in interfaceorg.openqa.selenium.PrintsPage
- Throws:
org.openqa.selenium.WebDriverException
-
findElement
public org.openqa.selenium.WebElement findElement(org.openqa.selenium.By locator)
- Specified by:
findElement
in interfaceorg.openqa.selenium.SearchContext
- Specified by:
findElement
in interfaceorg.openqa.selenium.WebDriver
-
findElements
public java.util.List<org.openqa.selenium.WebElement> findElements(org.openqa.selenium.By locator)
- Specified by:
findElements
in interfaceorg.openqa.selenium.SearchContext
- Specified by:
findElements
in interfaceorg.openqa.selenium.WebDriver
-
findElements
public java.util.List<org.openqa.selenium.WebElement> findElements(org.openqa.selenium.SearchContext context, java.util.function.BiFunction<java.lang.String,java.lang.Object,CommandPayload> findCommand, org.openqa.selenium.By locator)
-
findElement
@Deprecated protected org.openqa.selenium.WebElement findElement(java.lang.String by, java.lang.String using)
Deprecated.Rely on usingBy.Remotable
instead
-
findElements
@Deprecated protected java.util.List<org.openqa.selenium.WebElement> findElements(java.lang.String by, java.lang.String using)
Deprecated.Rely on usingBy.Remotable
instead
-
setFoundBy
protected void setFoundBy(org.openqa.selenium.SearchContext context, org.openqa.selenium.WebElement element, java.lang.String by, java.lang.String using)
-
getPageSource
public java.lang.String getPageSource()
- Specified by:
getPageSource
in interfaceorg.openqa.selenium.WebDriver
-
close
public void close()
- Specified by:
close
in interfaceorg.openqa.selenium.WebDriver
-
quit
public void quit()
- Specified by:
quit
in interfaceorg.openqa.selenium.WebDriver
-
getWindowHandles
public java.util.Set<java.lang.String> getWindowHandles()
- Specified by:
getWindowHandles
in interfaceorg.openqa.selenium.WebDriver
-
getWindowHandle
public java.lang.String getWindowHandle()
- Specified by:
getWindowHandle
in interfaceorg.openqa.selenium.WebDriver
-
executeScript
public java.lang.Object executeScript(java.lang.String script, java.lang.Object... args)
- Specified by:
executeScript
in interfaceorg.openqa.selenium.JavascriptExecutor
-
executeAsyncScript
public java.lang.Object executeAsyncScript(java.lang.String script, java.lang.Object... args)
- Specified by:
executeAsyncScript
in interfaceorg.openqa.selenium.JavascriptExecutor
-
switchTo
public org.openqa.selenium.WebDriver.TargetLocator switchTo()
- Specified by:
switchTo
in interfaceorg.openqa.selenium.WebDriver
-
navigate
public org.openqa.selenium.WebDriver.Navigation navigate()
- Specified by:
navigate
in interfaceorg.openqa.selenium.WebDriver
-
manage
public org.openqa.selenium.WebDriver.Options manage()
- Specified by:
manage
in interfaceorg.openqa.selenium.WebDriver
-
getElementConverter
protected JsonToWebElementConverter getElementConverter()
-
setElementConverter
protected void setElementConverter(JsonToWebElementConverter converter)
-
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:
perform
in interfaceorg.openqa.selenium.interactions.Interactive
-
resetInputState
public void resetInputState()
- Specified by:
resetInputState
in interfaceorg.openqa.selenium.interactions.Interactive
-
getKeyboard
public org.openqa.selenium.interactions.Keyboard getKeyboard()
- Specified by:
getKeyboard
in interfaceorg.openqa.selenium.interactions.HasInputDevices
-
getMouse
public org.openqa.selenium.interactions.Mouse getMouse()
- Specified by:
getMouse
in interfaceorg.openqa.selenium.interactions.HasInputDevices
-
addVirtualAuthenticator
public org.openqa.selenium.virtualauthenticator.VirtualAuthenticator addVirtualAuthenticator(org.openqa.selenium.virtualauthenticator.VirtualAuthenticatorOptions options)
- Specified by:
addVirtualAuthenticator
in interfaceorg.openqa.selenium.virtualauthenticator.HasVirtualAuthenticator
-
removeVirtualAuthenticator
public void removeVirtualAuthenticator(org.openqa.selenium.virtualauthenticator.VirtualAuthenticator authenticator)
- Specified by:
removeVirtualAuthenticator
in 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()
-
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
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-