Class WebDriverCommandProcessor
- java.lang.Object
-
- com.thoughtworks.selenium.webdriven.WebDriverCommandProcessor
-
- All Implemented Interfaces:
CommandProcessor
,org.openqa.selenium.WrapsDriver
public class WebDriverCommandProcessor extends java.lang.Object implements CommandProcessor, org.openqa.selenium.WrapsDriver
A CommandProcessor which delegates commands down to an underlying webdriver instance.
-
-
Constructor Summary
Constructors Constructor Description WebDriverCommandProcessor(java.lang.String baseUrl, java.util.function.Supplier<org.openqa.selenium.WebDriver> maker)
WebDriverCommandProcessor(java.lang.String baseUrl, org.openqa.selenium.WebDriver driver)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addMethod(java.lang.String methodName, SeleneseCommand<?> command)
void
addMutator(ScriptMutator mutator)
protected void
assertDriverSupportsJavascript(org.openqa.selenium.WebDriver driver)
java.lang.String
doCommand(java.lang.String commandName, java.lang.String[] args)
Send the specified remote command to the browser to be performedboolean
getBoolean(java.lang.String commandName, java.lang.String[] args)
boolean[]
getBooleanArray(java.lang.String s, java.lang.String[] strings)
SeleneseCommand<?>
getMethod(java.lang.String methodName)
java.lang.Number
getNumber(java.lang.String commandName, java.lang.String[] args)
java.lang.Number[]
getNumberArray(java.lang.String s, java.lang.String[] strings)
java.lang.String
getRemoteControlServerLocation()
The URL that the RemoteControl instance is allegedly running onjava.lang.String
getString(java.lang.String commandName, java.lang.String[] args)
java.lang.String[]
getStringArray(java.lang.String commandName, java.lang.String[] args)
org.openqa.selenium.WebDriver
getWrappedDriver()
boolean
isMethodAvailable(java.lang.String methodName)
void
setEnableAlertOverrides(boolean enableAlertOverrides)
Sets whether to enable emulation of Selenium's alert handling functions or to preserve WebDriver's alert handling.void
setExtensionJs(java.lang.String s)
Sets extension Javascript for the sessionvoid
start()
Starts a new Selenium testing sessionvoid
start(java.lang.Object o)
Starts a new Selenium testing session with a configuration options objectvoid
start(java.lang.String s)
Starts a new Selenium testing session with a String, representing a configurationvoid
stop()
Ends the current Selenium testing session (normally killing the browser)
-
-
-
Method Detail
-
getWrappedDriver
public org.openqa.selenium.WebDriver getWrappedDriver()
- Specified by:
getWrappedDriver
in interfaceorg.openqa.selenium.WrapsDriver
-
getRemoteControlServerLocation
public java.lang.String getRemoteControlServerLocation()
Description copied from interface:CommandProcessor
The URL that the RemoteControl instance is allegedly running on- Specified by:
getRemoteControlServerLocation
in interfaceCommandProcessor
- Returns:
- the URL
-
doCommand
public java.lang.String doCommand(java.lang.String commandName, java.lang.String[] args)
Description copied from interface:CommandProcessor
Send the specified remote command to the browser to be performed- Specified by:
doCommand
in interfaceCommandProcessor
- Parameters:
commandName
- - the remote command verbargs
- - the arguments to the remote command (depends on the verb)- Returns:
- - the command result, defined by the remote JavaScript. "getX" style commands may return data from the browser; other "doX" style commands may just return "OK" or an error message.
-
setExtensionJs
public void setExtensionJs(java.lang.String s)
Description copied from interface:CommandProcessor
Sets extension Javascript for the session- Specified by:
setExtensionJs
in interfaceCommandProcessor
- Parameters:
s
- extension javascript
-
start
public void start()
Description copied from interface:CommandProcessor
Starts a new Selenium testing session- Specified by:
start
in interfaceCommandProcessor
-
start
public void start(java.lang.String s)
Description copied from interface:CommandProcessor
Starts a new Selenium testing session with a String, representing a configuration- Specified by:
start
in interfaceCommandProcessor
- Parameters:
s
- option string
-
start
public void start(java.lang.Object o)
Description copied from interface:CommandProcessor
Starts a new Selenium testing session with a configuration options object- Specified by:
start
in interfaceCommandProcessor
- Parameters:
o
- options object
-
stop
public void stop()
Description copied from interface:CommandProcessor
Ends the current Selenium testing session (normally killing the browser)- Specified by:
stop
in interfaceCommandProcessor
-
getString
public java.lang.String getString(java.lang.String commandName, java.lang.String[] args)
- Specified by:
getString
in interfaceCommandProcessor
-
getStringArray
public java.lang.String[] getStringArray(java.lang.String commandName, java.lang.String[] args)
- Specified by:
getStringArray
in interfaceCommandProcessor
-
getNumber
public java.lang.Number getNumber(java.lang.String commandName, java.lang.String[] args)
- Specified by:
getNumber
in interfaceCommandProcessor
-
getNumberArray
public java.lang.Number[] getNumberArray(java.lang.String s, java.lang.String[] strings)
- Specified by:
getNumberArray
in interfaceCommandProcessor
-
getBoolean
public boolean getBoolean(java.lang.String commandName, java.lang.String[] args)
- Specified by:
getBoolean
in interfaceCommandProcessor
-
getBooleanArray
public boolean[] getBooleanArray(java.lang.String s, java.lang.String[] strings)
- Specified by:
getBooleanArray
in interfaceCommandProcessor
-
addMutator
public void addMutator(ScriptMutator mutator)
-
isMethodAvailable
public boolean isMethodAvailable(java.lang.String methodName)
-
addMethod
public void addMethod(java.lang.String methodName, SeleneseCommand<?> command)
-
getMethod
public SeleneseCommand<?> getMethod(java.lang.String methodName)
-
assertDriverSupportsJavascript
protected void assertDriverSupportsJavascript(org.openqa.selenium.WebDriver driver)
-
setEnableAlertOverrides
public void setEnableAlertOverrides(boolean enableAlertOverrides)
Sets whether to enable emulation of Selenium's alert handling functions or to preserve WebDriver's alert handling. This has no affect after callingstart()
.- Parameters:
enableAlertOverrides
- boolean to enable overrides
-
-