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_VERSION |
static String |
IS_HYBRID_APP |
List<String> |
simulatorList |
static int |
SYSTEM_PORT |
static String |
UIAUTOMATOR2 |
| Constructor and Description |
|---|
AndroidCapability() |
| Modifier and Type | Method and Description |
|---|---|
static 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() |
static List<String> |
getRealDevices(List<String> devices)
gets the name of the first real device connected
|
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
sets android home based on user.home location on mac
checks if the generated android home location exists, if true, adds to android.home config value
|
void |
setChromeDriver()
download chrome driver if hybrid app is enabled
if Version is LATEST, download latest driver unless set in config
|
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
a device or emulator must be connected
|
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 ANDROID_ENGINE
public static String UIAUTOMATOR2
public static boolean ANDROID_INIT
public static String ANDROID_HOME
public static String ANDROID_UDID
public static String IS_HYBRID_APP
public static String CHROME_VERSION
public static int SYSTEM_PORT
public AndroidCapability withCapability(org.openqa.selenium.remote.DesiredCapabilities Capabilities)
public AndroidCapability withDevice(String device)
device - public org.openqa.selenium.remote.DesiredCapabilities getCapability()
public String getAppPath()
public AndroidCapability withAndroidCapability()
public org.openqa.selenium.remote.DesiredCapabilities setAndroidCapabilties()
public void setChromeDriver()
public void setSingleSignIn()
public boolean isRealDeviceConnected()
devices - public static List<String> getRealDevices(List<String> devices)
devices - public static 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.