Class MobileDriver


  • public class MobileDriver
    extends UiDriver
    A driver used for working with a mobile applications(Android or iOS)
    • Method Detail

      • isAndroidAgent

        public boolean isAndroidAgent()
        Returns:
        whether the target agent is Android, otherwise it is iOS
      • getHost

        public String getHost()
      • isWorkingRemotely

        public boolean isWorkingRemotely()
      • setAndroidHome

        public void setAndroidHome​(String androidHome)
        Parameters:
        androidHome - example: "d:\\android\\android-sdk\\"
      • start

        public void start​(String appPath)
        Start session to device and load the application
        Parameters:
        appPath - filesystem path to the application - absolute or relative to the Appium server current dir
               iOS: absolute path to simulator-compiled .app file or the bundle_id of the desired target on device
               Android: absolute path to .apk file
         
      • stop

        public void stop()
        Description copied from class: UiDriver
        stop the driver
        Specified by:
        stop in class UiDriver
      • terminateApp

        public void terminateApp​(String applicationPackage)
        Stop application by name
        Parameters:
        applicationPackage - application package name
      • removeApp

        public void removeApp​(String applicationPackage)
        Remove application by name
        Parameters:
        applicationPackage - - bundle identifier or application ID of the application to be removed
      • clearAppCache

        public void clearAppCache​(String applicationPackage)
        Clear application cache
        Parameters:
        applicationPackage - application package name
      • getInternalObject

        public Object getInternalObject​(String objectName)
        NOTE: This method should not be used directly into the test scripts. The implementation may be changed by the Automation Framework Team without notice.
        Returns:
        Internal Object
      • getAndroidHome

        public String getAndroidHome()
        Returns:
        android home location
      • getAdbLocation

        public String getAdbLocation()
        Returns:
        adb location
      • setScreenshotOnError

        public void setScreenshotOnError​(boolean screenshotOnError)
        Parameters:
        screenshotOnError - whether to create screenshot on error
      • getScreenDimensions

        public org.openqa.selenium.Dimension getScreenDimensions()
      • stopIOSSimulator

        public void stopIOSSimulator()
        Stopping iOS Simulator