Class AppiumCommandExecutor

  • All Implemented Interfaces:
    org.openqa.selenium.logging.NeedsLocalLogs, org.openqa.selenium.remote.CommandExecutor

    public class AppiumCommandExecutor
    extends org.openqa.selenium.remote.HttpCommandExecutor
    • Field Summary

      • Fields inherited from class org.openqa.selenium.remote.HttpCommandExecutor

        client, commandCodec, responseCodec
    • Constructor Summary

      Constructors 
      Constructor Description
      AppiumCommandExecutor​(java.util.Map<java.lang.String,​org.openqa.selenium.remote.CommandInfo> additionalCommands, AppiumClientConfig appiumClientConfig)  
      AppiumCommandExecutor​(java.util.Map<java.lang.String,​org.openqa.selenium.remote.CommandInfo> additionalCommands, java.net.URL addressOfRemoteServer)  
      AppiumCommandExecutor​(java.util.Map<java.lang.String,​org.openqa.selenium.remote.CommandInfo> additionalCommands, java.net.URL addressOfRemoteServer, AppiumClientConfig appiumClientConfig)  
      AppiumCommandExecutor​(java.util.Map<java.lang.String,​org.openqa.selenium.remote.CommandInfo> additionalCommands, java.net.URL addressOfRemoteServer, org.openqa.selenium.remote.http.HttpClient.Factory httpClientFactory)  
      AppiumCommandExecutor​(java.util.Map<java.lang.String,​org.openqa.selenium.remote.CommandInfo> additionalCommands, org.openqa.selenium.remote.service.DriverService service)  
      AppiumCommandExecutor​(java.util.Map<java.lang.String,​org.openqa.selenium.remote.CommandInfo> additionalCommands, org.openqa.selenium.remote.service.DriverService service, AppiumClientConfig appiumClientConfig)  
      AppiumCommandExecutor​(java.util.Map<java.lang.String,​org.openqa.selenium.remote.CommandInfo> additionalCommands, org.openqa.selenium.remote.service.DriverService service, org.openqa.selenium.remote.http.HttpClient.Factory httpClientFactory)  
      AppiumCommandExecutor​(java.util.Map<java.lang.String,​org.openqa.selenium.remote.CommandInfo> additionalCommands, org.openqa.selenium.remote.service.DriverService service, org.openqa.selenium.remote.http.HttpClient.Factory httpClientFactory, AppiumClientConfig appiumClientConfig)
      Create an AppiumCommandExecutor instance.
    • Method Summary

      All Methods Instance Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      void defineCommand​(java.lang.String commandName, org.openqa.selenium.remote.CommandInfo info)  
      org.openqa.selenium.remote.Response execute​(org.openqa.selenium.remote.Command command)  
      java.util.Map<java.lang.String,​org.openqa.selenium.remote.CommandInfo> getAdditionalCommands()  
      protected org.openqa.selenium.remote.http.HttpClient getClient()  
      protected org.openqa.selenium.remote.CommandCodec<org.openqa.selenium.remote.http.HttpRequest> getCommandCodec()  
      protected <B> B getPrivateFieldValue​(java.lang.Class<? extends org.openqa.selenium.remote.CommandExecutor> cls, java.lang.String fieldName, java.lang.Class<B> fieldType)
      Deprecated.
      protected void overrideServerUrl​(java.net.URL serverUrl)
      Override the http client in the HttpCommandExecutor class with a new http client instance with the given URL.
      void refreshAdditionalCommands()  
      void setCommandCodec​(org.openqa.selenium.remote.CommandCodec<org.openqa.selenium.remote.http.HttpRequest> newCodec)  
      protected void setPrivateFieldValue​(java.lang.Class<? extends org.openqa.selenium.remote.CommandExecutor> cls, java.lang.String fieldName, java.lang.Object newValue)
      Deprecated.
      void setResponseCodec​(org.openqa.selenium.remote.ResponseCodec<org.openqa.selenium.remote.http.HttpResponse> codec)  
      • Methods inherited from class org.openqa.selenium.remote.HttpCommandExecutor

        getAddressOfRemoteServer, getDefaultClientFactory, setLocalLogs
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • AppiumCommandExecutor

        public AppiumCommandExecutor​(@Nonnull
                                     java.util.Map<java.lang.String,​org.openqa.selenium.remote.CommandInfo> additionalCommands,
                                     @Nullable
                                     org.openqa.selenium.remote.service.DriverService service,
                                     @Nullable
                                     org.openqa.selenium.remote.http.HttpClient.Factory httpClientFactory,
                                     @Nonnull
                                     AppiumClientConfig appiumClientConfig)
        Create an AppiumCommandExecutor instance.
        Parameters:
        additionalCommands - is the map of Appium commands
        service - take a look at DriverService
        httpClientFactory - take a look at HttpClient.Factory
        appiumClientConfig - take a look at AppiumClientConfig
      • AppiumCommandExecutor

        public AppiumCommandExecutor​(java.util.Map<java.lang.String,​org.openqa.selenium.remote.CommandInfo> additionalCommands,
                                     org.openqa.selenium.remote.service.DriverService service,
                                     org.openqa.selenium.remote.http.HttpClient.Factory httpClientFactory)
      • AppiumCommandExecutor

        public AppiumCommandExecutor​(java.util.Map<java.lang.String,​org.openqa.selenium.remote.CommandInfo> additionalCommands,
                                     java.net.URL addressOfRemoteServer,
                                     org.openqa.selenium.remote.http.HttpClient.Factory httpClientFactory)
      • AppiumCommandExecutor

        public AppiumCommandExecutor​(java.util.Map<java.lang.String,​org.openqa.selenium.remote.CommandInfo> additionalCommands,
                                     AppiumClientConfig appiumClientConfig)
      • AppiumCommandExecutor

        public AppiumCommandExecutor​(java.util.Map<java.lang.String,​org.openqa.selenium.remote.CommandInfo> additionalCommands,
                                     java.net.URL addressOfRemoteServer)
      • AppiumCommandExecutor

        public AppiumCommandExecutor​(java.util.Map<java.lang.String,​org.openqa.selenium.remote.CommandInfo> additionalCommands,
                                     java.net.URL addressOfRemoteServer,
                                     AppiumClientConfig appiumClientConfig)
      • AppiumCommandExecutor

        public AppiumCommandExecutor​(java.util.Map<java.lang.String,​org.openqa.selenium.remote.CommandInfo> additionalCommands,
                                     org.openqa.selenium.remote.service.DriverService service)
      • AppiumCommandExecutor

        public AppiumCommandExecutor​(java.util.Map<java.lang.String,​org.openqa.selenium.remote.CommandInfo> additionalCommands,
                                     org.openqa.selenium.remote.service.DriverService service,
                                     AppiumClientConfig appiumClientConfig)
    • Method Detail

      • getPrivateFieldValue

        @Deprecated
        protected <B> B getPrivateFieldValue​(java.lang.Class<? extends org.openqa.selenium.remote.CommandExecutor> cls,
                                             java.lang.String fieldName,
                                             java.lang.Class<B> fieldType)
        Deprecated.
      • setPrivateFieldValue

        @Deprecated
        protected void setPrivateFieldValue​(java.lang.Class<? extends org.openqa.selenium.remote.CommandExecutor> cls,
                                            java.lang.String fieldName,
                                            java.lang.Object newValue)
        Deprecated.
      • getAdditionalCommands

        public java.util.Map<java.lang.String,​org.openqa.selenium.remote.CommandInfo> getAdditionalCommands()
      • getCommandCodec

        protected org.openqa.selenium.remote.CommandCodec<org.openqa.selenium.remote.http.HttpRequest> getCommandCodec()
      • setCommandCodec

        public void setCommandCodec​(org.openqa.selenium.remote.CommandCodec<org.openqa.selenium.remote.http.HttpRequest> newCodec)
      • setResponseCodec

        public void setResponseCodec​(org.openqa.selenium.remote.ResponseCodec<org.openqa.selenium.remote.http.HttpResponse> codec)
      • getClient

        protected org.openqa.selenium.remote.http.HttpClient getClient()
      • overrideServerUrl

        protected void overrideServerUrl​(java.net.URL serverUrl)
        Override the http client in the HttpCommandExecutor class with a new http client instance with the given URL. It uses the same http client factory and client config for the new http client instance if the constructor got them.
        Parameters:
        serverUrl - A url to override.
      • refreshAdditionalCommands

        public void refreshAdditionalCommands()
      • defineCommand

        public void defineCommand​(java.lang.String commandName,
                                  org.openqa.selenium.remote.CommandInfo info)
        Overrides:
        defineCommand in class org.openqa.selenium.remote.HttpCommandExecutor
      • execute

        public org.openqa.selenium.remote.Response execute​(org.openqa.selenium.remote.Command command)
                                                    throws org.openqa.selenium.WebDriverException
        Specified by:
        execute in interface org.openqa.selenium.remote.CommandExecutor
        Overrides:
        execute in class org.openqa.selenium.remote.HttpCommandExecutor
        Throws:
        org.openqa.selenium.WebDriverException