Class AppiumDriver

    • Nested Class Summary

      • Nested classes/interfaces inherited from class org.openqa.selenium.remote.RemoteWebDriver

        org.openqa.selenium.remote.RemoteWebDriver.RemoteTargetLocator, org.openqa.selenium.remote.RemoteWebDriver.RemoteWebDriverOptions, org.openqa.selenium.remote.RemoteWebDriver.When
      • Nested classes/interfaces inherited from interface org.openqa.selenium.WebDriver

        org.openqa.selenium.WebDriver.ImeHandler, org.openqa.selenium.WebDriver.Navigation, org.openqa.selenium.WebDriver.Options, org.openqa.selenium.WebDriver.TargetLocator, org.openqa.selenium.WebDriver.Timeouts, org.openqa.selenium.WebDriver.Window
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected org.openqa.selenium.remote.html5.RemoteLocationContext locationContext  
    • Constructor Summary

      Constructors 
      Constructor Description
      AppiumDriver​(AppiumDriverLocalService service, org.openqa.selenium.Capabilities capabilities)  
      AppiumDriver​(AppiumDriverLocalService service, org.openqa.selenium.remote.http.HttpClient.Factory httpClientFactory, org.openqa.selenium.Capabilities capabilities)  
      AppiumDriver​(AppiumServiceBuilder builder, org.openqa.selenium.Capabilities capabilities)  
      AppiumDriver​(AppiumServiceBuilder builder, org.openqa.selenium.remote.http.HttpClient.Factory httpClientFactory, org.openqa.selenium.Capabilities capabilities)  
      AppiumDriver​(java.net.URL remoteAddress, org.openqa.selenium.Capabilities capabilities)  
      AppiumDriver​(java.net.URL remoteAddress, org.openqa.selenium.remote.http.HttpClient.Factory httpClientFactory, org.openqa.selenium.Capabilities capabilities)  
      AppiumDriver​(org.openqa.selenium.Capabilities capabilities)  
      AppiumDriver​(org.openqa.selenium.remote.http.HttpClient.Factory httpClientFactory, org.openqa.selenium.Capabilities capabilities)  
      AppiumDriver​(org.openqa.selenium.remote.HttpCommandExecutor executor, org.openqa.selenium.Capabilities capabilities)
      Creates a new instance based on command executor and capabilities.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addCommand​(org.openqa.selenium.remote.http.HttpMethod httpMethod, java.lang.String url, java.lang.String methodName)
      This method is used to add custom appium commands in Appium 2.0.
      protected static org.openqa.selenium.Capabilities ensureAutomationName​(org.openqa.selenium.Capabilities originalCapabilities, java.lang.String defaultName)
      Changes automation name if it is not set and returns merged capabilities.
      protected static org.openqa.selenium.Capabilities ensurePlatformAndAutomationNames​(org.openqa.selenium.Capabilities originalCapabilities, java.lang.String defaultPlatformName, java.lang.String defaultAutomationName)
      Changes platform and automation names if they are not set and returns merged capabilities.
      protected static org.openqa.selenium.Capabilities ensurePlatformName​(org.openqa.selenium.Capabilities originalCapabilities, java.lang.String defaultName)
      Changes platform name if it is not set and returns merged capabilities.
      org.openqa.selenium.remote.Response execute​(java.lang.String command)
      Executes the given command and returns a response.
      org.openqa.selenium.remote.Response execute​(java.lang.String driverCommand, java.util.Map<java.lang.String,​?> parameters)
      Executes the given command and returns a response.
      org.openqa.selenium.remote.ExecuteMethod getExecuteMethod()  
      java.net.URL getRemoteAddress()  
      java.util.Map<java.lang.String,​java.lang.Object> getStatus()
      This method is used to get build version status of running Appium server.
      protected void startSession​(org.openqa.selenium.Capabilities capabilities)  
      • Methods inherited from class org.openqa.selenium.remote.RemoteWebDriver

        addVirtualAuthenticator, builder, close, execute, executeAsyncScript, executeScript, findElement, findElement, findElements, findElements, findElements, get, getCapabilities, getCommandExecutor, getCurrentUrl, getElementConverter, getErrorHandler, getFileDetector, getKeyboard, getMouse, getPageSource, getScreenshotAs, getSessionId, getTitle, getWindowHandle, getWindowHandles, log, manage, navigate, perform, print, quit, removeVirtualAuthenticator, resetInputState, setCommandExecutor, setElementConverter, setErrorHandler, setFileDetector, setFoundBy, setLogLevel, setSessionId, switchTo, toString
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface org.openqa.selenium.HasCapabilities

        getCapabilities
      • Methods inherited from interface org.openqa.selenium.JavascriptExecutor

        executeScript, getPinnedScripts, pin, unpin
    • Field Detail

      • locationContext

        protected final org.openqa.selenium.remote.html5.RemoteLocationContext locationContext
    • Constructor Detail

      • AppiumDriver

        public AppiumDriver​(org.openqa.selenium.remote.HttpCommandExecutor executor,
                            org.openqa.selenium.Capabilities capabilities)
        Creates a new instance based on command executor and capabilities.
        Parameters:
        executor - is an instance of HttpCommandExecutor or class that extends it. Default commands or another vendor-specific commands may be specified there.
        capabilities - take a look at Capabilities
      • AppiumDriver

        public AppiumDriver​(java.net.URL remoteAddress,
                            org.openqa.selenium.Capabilities capabilities)
      • AppiumDriver

        public AppiumDriver​(java.net.URL remoteAddress,
                            org.openqa.selenium.remote.http.HttpClient.Factory httpClientFactory,
                            org.openqa.selenium.Capabilities capabilities)
      • AppiumDriver

        public AppiumDriver​(AppiumDriverLocalService service,
                            org.openqa.selenium.Capabilities capabilities)
      • AppiumDriver

        public AppiumDriver​(AppiumDriverLocalService service,
                            org.openqa.selenium.remote.http.HttpClient.Factory httpClientFactory,
                            org.openqa.selenium.Capabilities capabilities)
      • AppiumDriver

        public AppiumDriver​(AppiumServiceBuilder builder,
                            org.openqa.selenium.Capabilities capabilities)
      • AppiumDriver

        public AppiumDriver​(AppiumServiceBuilder builder,
                            org.openqa.selenium.remote.http.HttpClient.Factory httpClientFactory,
                            org.openqa.selenium.Capabilities capabilities)
      • AppiumDriver

        public AppiumDriver​(org.openqa.selenium.remote.http.HttpClient.Factory httpClientFactory,
                            org.openqa.selenium.Capabilities capabilities)
      • AppiumDriver

        public AppiumDriver​(org.openqa.selenium.Capabilities capabilities)
    • Method Detail

      • ensurePlatformName

        protected static org.openqa.selenium.Capabilities ensurePlatformName​(org.openqa.selenium.Capabilities originalCapabilities,
                                                                             java.lang.String defaultName)
        Changes platform name if it is not set and returns merged capabilities.
        Parameters:
        originalCapabilities - the given Capabilities.
        defaultName - a CapabilityType.PLATFORM_NAME value which has to be set up
        Returns:
        Capabilities with changed platform name value or the original capabilities
      • ensureAutomationName

        protected static org.openqa.selenium.Capabilities ensureAutomationName​(org.openqa.selenium.Capabilities originalCapabilities,
                                                                               java.lang.String defaultName)
        Changes automation name if it is not set and returns merged capabilities.
        Parameters:
        originalCapabilities - the given Capabilities.
        defaultName - a MobileCapabilityType.AUTOMATION_NAME value which has to be set up
        Returns:
        Capabilities with changed mobile automation name value or the original capabilities
      • ensurePlatformAndAutomationNames

        protected static org.openqa.selenium.Capabilities ensurePlatformAndAutomationNames​(org.openqa.selenium.Capabilities originalCapabilities,
                                                                                           java.lang.String defaultPlatformName,
                                                                                           java.lang.String defaultAutomationName)
        Changes platform and automation names if they are not set and returns merged capabilities.
        Parameters:
        originalCapabilities - the given Capabilities.
        defaultPlatformName - a CapabilityType.PLATFORM_NAME value which has to be set up
        defaultAutomationName - The default automation name to set up for this class
        Returns:
        Capabilities with changed platform/automation name value or the original capabilities
      • getExecuteMethod

        public org.openqa.selenium.remote.ExecuteMethod getExecuteMethod()
        Overrides:
        getExecuteMethod in class org.openqa.selenium.remote.RemoteWebDriver
      • getStatus

        public java.util.Map<java.lang.String,​java.lang.Object> getStatus()
        This method is used to get build version status of running Appium server.
        Returns:
        map containing version details
      • addCommand

        public void addCommand​(org.openqa.selenium.remote.http.HttpMethod httpMethod,
                               java.lang.String url,
                               java.lang.String methodName)
        This method is used to add custom appium commands in Appium 2.0.
        Parameters:
        httpMethod - the available HttpMethod.
        url - The url to URL template as https://www.w3.org/TR/webdriver/#endpoints.
        methodName - The name of custom appium command.
      • getRemoteAddress

        public java.net.URL getRemoteAddress()
      • startSession

        protected void startSession​(org.openqa.selenium.Capabilities capabilities)
        Overrides:
        startSession in class org.openqa.selenium.remote.RemoteWebDriver
      • execute

        public org.openqa.selenium.remote.Response execute​(java.lang.String driverCommand,
                                                           java.util.Map<java.lang.String,​?> parameters)
        Description copied from interface: ExecutesMethod
        Executes the given command and returns a response.
        Specified by:
        execute in interface ExecutesMethod
        Overrides:
        execute in class org.openqa.selenium.remote.RemoteWebDriver
        Parameters:
        driverCommand - a command to execute
        parameters - map of command parameters
        Returns:
        a result response
      • execute

        public org.openqa.selenium.remote.Response execute​(java.lang.String command)
        Description copied from interface: ExecutesMethod
        Executes the given command and returns a response.
        Specified by:
        execute in interface ExecutesMethod
        Overrides:
        execute in class org.openqa.selenium.remote.RemoteWebDriver
        Parameters:
        command - a command to execute
        Returns:
        a result response