Package com.axway.ats.uiengine
Class MobileDriver
- java.lang.Object
-
- com.axway.ats.uiengine.UiDriver
-
- com.axway.ats.uiengine.MobileDriver
-
public class MobileDriver extends UiDriver
A driver used for working with a mobile applications(Android or iOS)
-
-
Field Summary
Fields Modifier and Type Field Description static StringDEVICE_ANDROIDstatic StringDEVICE_ANDROID_EMULATORstatic StringDEVICE_IPAD_SIMULATORstatic StringDEVICE_IPHONE_SIMULATORstatic StringNATIVE_CONTEXT
-
Constructor Summary
Constructors Constructor Description MobileDriver(String deviceName, String platformVersion, String udid)MobileDriver(String deviceName, String platformVersion, String udid, String host)MobileDriver(String deviceName, String platformVersion, String udid, String host, int port)
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidclearAppCache(String applicationPackage)Clear application cacheStringgetAdbLocation()StringgetAndroidHome()StringgetHost()ObjectgetInternalObject(String objectName)NOTE: This method should not be used directly into the test scripts.MobileEnginegetMobileEngine()org.openqa.selenium.DimensiongetScreenDimensions()booleanisAndroidAgent()booleanisWorkingRemotely()voidremoveApp(String applicationPackage)Remove application by namevoidsetAndroidHome(String androidHome)voidsetScreenshotOnError(boolean screenshotOnError)voidstart()Deprecated.Usestart(String)method instead.voidstart(String appPath)Start session to device and load the applicationvoidstop()stop the drivervoidstopIOSSimulator()Stopping iOS SimulatorvoidterminateApp(String applicationPackage)Stop application by name-
Methods inherited from class com.axway.ats.uiengine.UiDriver
getChromeDriver, getChromeDriver, getCustomDriver, getEdgeDriver, getEdgeDriver, getFirefoxDriver, getFirefoxDriver, getFirefoxDriver, getHiddenBrowserDriver, getHiddenBrowserDriver, getInternetExplorerDriver, getInternetExplorerDriver, getMobileDriver, getMobileDriver, getPhantomJSDriver, getRobotDriver, getSafariDriver, getSafariDriver, getSwingDriver, getSwingDriver, getSwingDriver, getSwingDriver
-
-
-
-
Field Detail
-
DEVICE_ANDROID_EMULATOR
public static final String DEVICE_ANDROID_EMULATOR
- See Also:
- Constant Field Values
-
DEVICE_ANDROID
public static final String DEVICE_ANDROID
- See Also:
- Constant Field Values
-
DEVICE_IPHONE_SIMULATOR
public static final String DEVICE_IPHONE_SIMULATOR
- See Also:
- Constant Field Values
-
DEVICE_IPAD_SIMULATOR
public static final String DEVICE_IPAD_SIMULATOR
- See Also:
- Constant Field Values
-
NATIVE_CONTEXT
public static final String NATIVE_CONTEXT
- See Also:
- Constant Field Values
-
-
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
@Deprecated public void start()
Deprecated.Usestart(String)method instead.Start session to device
-
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 diriOS: 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:UiDriverstop the driver
-
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
-
getMobileEngine
public MobileEngine getMobileEngine()
-
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
-
-