org.openqa.selenium
Class WebDriverCommandProcessor

java.lang.Object
  extended by org.openqa.selenium.WebDriverCommandProcessor
All Implemented Interfaces:
CommandProcessor, WrapsDriver

public class WebDriverCommandProcessor
extends Object
implements CommandProcessor, WrapsDriver

A CommandProcessor which delegates commands down to an underlying webdriver instance.


Constructor Summary
WebDriverCommandProcessor(String baseUrl)
          Create an instance that will later be configured by calling start(Object) with a Capabilities instance.
WebDriverCommandProcessor(String baseUrl, Capabilities likeThis)
          Create an instance that will later be started by calling start()
WebDriverCommandProcessor(String baseUrl, com.google.common.base.Supplier<WebDriver> maker)
           
WebDriverCommandProcessor(String baseUrl, WebDriver driver)
           
 
Method Summary
 void addMethod(String methodName, SeleneseCommand command)
           
 void addMutator(ScriptMutator mutator)
           
protected  void assertDriverSupportsJavascript(WebDriver driver)
           
 String doCommand(String commandName, String[] args)
          Send the specified remote command to the browser to be performed
 boolean getBoolean(String commandName, String[] args)
           
 boolean[] getBooleanArray(String s, String[] strings)
           
 SeleneseCommand getMethod(String methodName)
           
 Number getNumber(String commandName, String[] args)
           
 Number[] getNumberArray(String s, String[] strings)
           
 String getRemoteControlServerLocation()
          The URL that the RemoteControl instance is allegedly running on
 String getString(String commandName, String[] args)
           
 String[] getStringArray(String commandName, String[] args)
           
 WebDriver getWrappedDriver()
           
 boolean isMethodAvailable(String methodName)
           
 void setExtensionJs(String s)
          Sets extension Javascript for the session
 void start()
          Starts a new Selenium testing session
 void start(Object o)
          Starts a new Selenium testing session with a configuration options object
 void start(String s)
          Starts a new Selenium testing session with a String, representing a configuration
 void stop()
          Ends the current Selenium testing session (normally killing the browser)
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WebDriverCommandProcessor

public WebDriverCommandProcessor(String baseUrl)
Create an instance that will later be configured by calling start(Object) with a Capabilities instance.

Parameters:
baseUrl - The URL from which relative URLs should be based on

WebDriverCommandProcessor

public WebDriverCommandProcessor(String baseUrl,
                                 Capabilities likeThis)
Create an instance that will later be started by calling start()

Parameters:
baseUrl - The URL from which relative URLs should be based on
likeThis - Typically a DesiredCapabilities instance

WebDriverCommandProcessor

public WebDriverCommandProcessor(String baseUrl,
                                 WebDriver driver)

WebDriverCommandProcessor

public WebDriverCommandProcessor(String baseUrl,
                                 com.google.common.base.Supplier<WebDriver> maker)
Method Detail

getWrappedDriver

public WebDriver getWrappedDriver()
Specified by:
getWrappedDriver in interface WrapsDriver
Returns:
The driver that contains this element.

getRemoteControlServerLocation

public String getRemoteControlServerLocation()
Description copied from interface: CommandProcessor
The URL that the RemoteControl instance is allegedly running on

Specified by:
getRemoteControlServerLocation in interface CommandProcessor
Returns:
the URL

doCommand

public String doCommand(String commandName,
                        String[] args)
Description copied from interface: CommandProcessor
Send the specified remote command to the browser to be performed

Specified by:
doCommand in interface CommandProcessor
Parameters:
commandName - - the remote command verb
args - - 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(String s)
Description copied from interface: CommandProcessor
Sets extension Javascript for the session

Specified by:
setExtensionJs in interface CommandProcessor

start

public void start()
Description copied from interface: CommandProcessor
Starts a new Selenium testing session

Specified by:
start in interface CommandProcessor

start

public void start(String s)
Description copied from interface: CommandProcessor
Starts a new Selenium testing session with a String, representing a configuration

Specified by:
start in interface CommandProcessor

start

public void start(Object o)
Description copied from interface: CommandProcessor
Starts a new Selenium testing session with a configuration options object

Specified by:
start in interface CommandProcessor

stop

public void stop()
Description copied from interface: CommandProcessor
Ends the current Selenium testing session (normally killing the browser)

Specified by:
stop in interface CommandProcessor

getString

public String getString(String commandName,
                        String[] args)
Specified by:
getString in interface CommandProcessor

getStringArray

public String[] getStringArray(String commandName,
                               String[] args)
Specified by:
getStringArray in interface CommandProcessor

getNumber

public Number getNumber(String commandName,
                        String[] args)
Specified by:
getNumber in interface CommandProcessor

getNumberArray

public Number[] getNumberArray(String s,
                               String[] strings)
Specified by:
getNumberArray in interface CommandProcessor

getBoolean

public boolean getBoolean(String commandName,
                          String[] args)
Specified by:
getBoolean in interface CommandProcessor

getBooleanArray

public boolean[] getBooleanArray(String s,
                                 String[] strings)
Specified by:
getBooleanArray in interface CommandProcessor

addMutator

public void addMutator(ScriptMutator mutator)

isMethodAvailable

public boolean isMethodAvailable(String methodName)

addMethod

public void addMethod(String methodName,
                      SeleneseCommand command)

getMethod

public SeleneseCommand getMethod(String methodName)

assertDriverSupportsJavascript

protected void assertDriverSupportsJavascript(WebDriver driver)


Copyright © 2011. All Rights Reserved.