Class 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 performed
      boolean 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 on
      java.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 session
      void start()
      Starts a new Selenium testing session
      void start​(java.lang.Object o)
      Starts a new Selenium testing session with a configuration options object
      void start​(java.lang.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​(java.lang.String baseUrl,
                                         org.openqa.selenium.WebDriver driver)
      • WebDriverCommandProcessor

        public WebDriverCommandProcessor​(java.lang.String baseUrl,
                                         java.util.function.Supplier<org.openqa.selenium.WebDriver> maker)
    • Method Detail

      • getWrappedDriver

        public org.openqa.selenium.WebDriver getWrappedDriver()
        Specified by:
        getWrappedDriver in interface org.openqa.selenium.WrapsDriver
      • 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 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​(java.lang.String s)
        Description copied from interface: CommandProcessor
        Sets extension Javascript for the session
        Specified by:
        setExtensionJs in interface CommandProcessor
        Parameters:
        s - extension javascript
      • 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 interface CommandProcessor
        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 interface CommandProcessor
        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 interface CommandProcessor
      • getString

        public java.lang.String getString​(java.lang.String commandName,
                                          java.lang.String[] args)
        Specified by:
        getString in interface CommandProcessor
      • getStringArray

        public java.lang.String[] getStringArray​(java.lang.String commandName,
                                                 java.lang.String[] args)
        Specified by:
        getStringArray in interface CommandProcessor
      • getNumber

        public java.lang.Number getNumber​(java.lang.String commandName,
                                          java.lang.String[] args)
        Specified by:
        getNumber in interface CommandProcessor
      • getNumberArray

        public java.lang.Number[] getNumberArray​(java.lang.String s,
                                                 java.lang.String[] strings)
        Specified by:
        getNumberArray in interface CommandProcessor
      • getBoolean

        public boolean getBoolean​(java.lang.String commandName,
                                  java.lang.String[] args)
        Specified by:
        getBoolean in interface CommandProcessor
      • getBooleanArray

        public boolean[] getBooleanArray​(java.lang.String s,
                                         java.lang.String[] strings)
        Specified by:
        getBooleanArray in interface CommandProcessor
      • 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 calling start().
        Parameters:
        enableAlertOverrides - boolean to enable overrides