public class AndroidCapability extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
ANDROID_ENGINE |
static String |
ANDROID_HOME |
static boolean |
ANDROID_INIT |
static String |
ANDROID_UDID |
static String |
APP_DIR_PATH |
static String |
APP_NAME |
org.openqa.selenium.remote.DesiredCapabilities |
capabilities |
static String |
CHROME_DRIVER_PATH |
static String |
CHROME_VERSION |
static String |
iS_CHROME_AUTO_MANAGE |
List<String> |
simulatorList |
static int |
SYSTEM_PORT |
static String |
UIAUTOMATOR2 |
| Constructor and Description |
|---|
AndroidCapability() |
| Modifier and Type | Method and Description |
|---|---|
String |
chromeDriverPath() |
List<String> |
getAndroidDeviceList()
gets the list of android devices including real devices + emulators skips the
first item, as it is not a device
|
List<String> |
getAndroidRealDeviceList() |
String |
getAppPath() |
org.openqa.selenium.remote.DesiredCapabilities |
getCapability() |
String |
getChromeDriverVersion() |
static List<String> |
getRealDevices(List<String> devices)
gets the name of the first real device connected
|
boolean |
isChromeAutoManager() |
boolean |
isRealDeviceConnected()
if adb device contains emulator, Then its an emulator otherwise, its a
connected real device
|
static void |
printAndroidHelp(Exception e) |
static void |
restartAdb() |
org.openqa.selenium.remote.DesiredCapabilities |
setAndroidCapabilties()
set capabilties with prefix android.capabilties.
|
void |
setAndroidDevice()
sets device by following strategy: if device is connected, selects device if
emulator is not specified with "withDevice1() or with Device2() function,
select device 1 by default from properties else select emulator from
properties specified in panel config page
|
static void |
setAndroidHome()
sets the value for android home based on its default location
|
void |
setChromePath()
set chrome version if value set in properties file to use: set
appiumChromeVersion, Then appiumChromeAutoManage if appiumChromeAutoManage =
true : version will automatically download if appiumChromeAutoManage = false
: set the path to the location
|
void |
setPort(String deviceName)
if device has port assigned, use assigned port
else generate new port number
|
void |
setRealDevices()
sets real device
|
void |
setSimulator()
sets ios device number of devices must be equal or greater than number of
threads for parallel run
|
void |
setSingleSignIn()
runs subsequent tests without restarting the app removes the need to sign in
on every test if tests fail, it will restart the app
|
static void |
uninstallUiAutomator2()
uninstalls the uiautomator2 server
only runs the first time android test is run
|
AndroidCapability |
withAndroidCapability()
sets android capabilities values are from maven or properties file maven has
higher priority than properties
|
AndroidCapability |
withCapability(org.openqa.selenium.remote.DesiredCapabilities Capabilities) |
AndroidCapability |
withDevice(String device)
device: property name from property file.
|
public org.openqa.selenium.remote.DesiredCapabilities capabilities
public static String APP_DIR_PATH
public static String APP_NAME
public static String CHROME_VERSION
public static String iS_CHROME_AUTO_MANAGE
public static String CHROME_DRIVER_PATH
public static String ANDROID_ENGINE
public static String UIAUTOMATOR2
public static boolean ANDROID_INIT
public static String ANDROID_HOME
public static String ANDROID_UDID
public static int SYSTEM_PORT
public AndroidCapability withCapability(org.openqa.selenium.remote.DesiredCapabilities Capabilities)
public AndroidCapability withDevice(String device)
device - public String getChromeDriverVersion()
public boolean isChromeAutoManager()
public String chromeDriverPath()
public org.openqa.selenium.remote.DesiredCapabilities getCapability()
public String getAppPath()
public AndroidCapability withAndroidCapability()
public org.openqa.selenium.remote.DesiredCapabilities setAndroidCapabilties()
public void setChromePath()
public void setSingleSignIn()
public boolean isRealDeviceConnected()
devices - public static List<String> getRealDevices(List<String> devices)
devices - public List<String> getAndroidDeviceList()
public void setSimulator()
public void setPort(String deviceName)
deviceName - public static void restartAdb()
public static void uninstallUiAutomator2()
public void setRealDevices()
public void setAndroidDevice()
public static void printAndroidHelp(Exception e)
public static void setAndroidHome()
Copyright © 2019. All rights reserved.