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 voidaddMethod(java.lang.String methodName, SeleneseCommand<?> command)voidaddMutator(ScriptMutator mutator)protected voidassertDriverSupportsJavascript(org.openqa.selenium.WebDriver driver)java.lang.StringdoCommand(java.lang.String commandName, java.lang.String[] args)Send the specified remote command to the browser to be performedbooleangetBoolean(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.NumbergetNumber(java.lang.String commandName, java.lang.String[] args)java.lang.Number[]getNumberArray(java.lang.String s, java.lang.String[] strings)java.lang.StringgetRemoteControlServerLocation()The URL that the RemoteControl instance is allegedly running onjava.lang.StringgetString(java.lang.String commandName, java.lang.String[] args)java.lang.String[]getStringArray(java.lang.String commandName, java.lang.String[] args)org.openqa.selenium.WebDrivergetWrappedDriver()booleanisMethodAvailable(java.lang.String methodName)voidsetEnableAlertOverrides(boolean enableAlertOverrides)Sets whether to enable emulation of Selenium's alert handling functions or to preserve WebDriver's alert handling.voidsetExtensionJs(java.lang.String s)Sets extension Javascript for the sessionvoidstart()Starts a new Selenium testing sessionvoidstart(java.lang.Object o)Starts a new Selenium testing session with a configuration options objectvoidstart(java.lang.String s)Starts a new Selenium testing session with a String, representing a configurationvoidstop()Ends the current Selenium testing session (normally killing the browser) 
 - 
 
- 
- 
Method Detail
- 
getWrappedDriver
public org.openqa.selenium.WebDriver getWrappedDriver()
- Specified by:
 getWrappedDriverin interfaceorg.openqa.selenium.WrapsDriver
 
- 
getRemoteControlServerLocation
public java.lang.String getRemoteControlServerLocation()
Description copied from interface:CommandProcessorThe URL that the RemoteControl instance is allegedly running on- Specified by:
 getRemoteControlServerLocationin interfaceCommandProcessor- Returns:
 - the URL
 
 
- 
doCommand
public java.lang.String doCommand(java.lang.String commandName, java.lang.String[] args)Description copied from interface:CommandProcessorSend the specified remote command to the browser to be performed- Specified by:
 doCommandin 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:CommandProcessorSets extension Javascript for the session- Specified by:
 setExtensionJsin interfaceCommandProcessor- Parameters:
 s- extension javascript
 
- 
start
public void start()
Description copied from interface:CommandProcessorStarts a new Selenium testing session- Specified by:
 startin interfaceCommandProcessor
 
- 
start
public void start(java.lang.String s)
Description copied from interface:CommandProcessorStarts a new Selenium testing session with a String, representing a configuration- Specified by:
 startin interfaceCommandProcessor- Parameters:
 s- option string
 
- 
start
public void start(java.lang.Object o)
Description copied from interface:CommandProcessorStarts a new Selenium testing session with a configuration options object- Specified by:
 startin interfaceCommandProcessor- Parameters:
 o- options object
 
- 
stop
public void stop()
Description copied from interface:CommandProcessorEnds the current Selenium testing session (normally killing the browser)- Specified by:
 stopin interfaceCommandProcessor
 
- 
getString
public java.lang.String getString(java.lang.String commandName, java.lang.String[] args)- Specified by:
 getStringin interfaceCommandProcessor
 
- 
getStringArray
public java.lang.String[] getStringArray(java.lang.String commandName, java.lang.String[] args)- Specified by:
 getStringArrayin interfaceCommandProcessor
 
- 
getNumber
public java.lang.Number getNumber(java.lang.String commandName, java.lang.String[] args)- Specified by:
 getNumberin interfaceCommandProcessor
 
- 
getNumberArray
public java.lang.Number[] getNumberArray(java.lang.String s, java.lang.String[] strings)- Specified by:
 getNumberArrayin interfaceCommandProcessor
 
- 
getBoolean
public boolean getBoolean(java.lang.String commandName, java.lang.String[] args)- Specified by:
 getBooleanin interfaceCommandProcessor
 
- 
getBooleanArray
public boolean[] getBooleanArray(java.lang.String s, java.lang.String[] strings)- Specified by:
 getBooleanArrayin 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
 
 - 
 
 -