RequiredElementType - means the required type from the list of allowed types below
that implement WebElement Instances of the defined type will be
returned via findElement* and findElements*.
Warning (!!!). Allowed types:WebElementTouchableElementRemoteWebElementMobileElement
AndroidElementpublic class AndroidDriver<RequiredElementType extends org.openqa.selenium.WebElement> extends AppiumDriver<RequiredElementType> implements AndroidDeviceActionShortcuts, HasNetworkConnection, PushesFiles, StartsActivity, FindsByAndroidUIAutomator<RequiredElementType>
org.openqa.selenium.remote.RemoteWebDriver.RemoteTargetLocator, org.openqa.selenium.remote.RemoteWebDriver.RemoteWebDriverOptions, org.openqa.selenium.remote.RemoteWebDriver.Whenorg.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.WindowKEY_CODE, PATH| Constructor and Description |
|---|
AndroidDriver(AppiumDriverLocalService service,
org.openqa.selenium.Capabilities desiredCapabilities) |
AndroidDriver(AppiumServiceBuilder builder,
org.openqa.selenium.Capabilities desiredCapabilities) |
AndroidDriver(org.openqa.selenium.Capabilities desiredCapabilities) |
AndroidDriver(URL remoteAddress,
org.openqa.selenium.Capabilities desiredCapabilities) |
| Modifier and Type | Method and Description |
|---|---|
String |
currentActivity()
Get the current activity being run on the mobile device
|
void |
endTestCoverage(String intent,
String path)
Get test-coverage data
|
org.openqa.selenium.remote.Response |
execute(String driverCommand,
Map<String,?> parameters) |
T |
findElement(org.openqa.selenium.By by) |
T |
findElementByAccessibilityId(String using) |
RequiredElementType |
findElementByAndroidUIAutomator(String using) |
T |
findElementByClassName(String using) |
T |
findElementByCssSelector(String using) |
T |
findElementById(String id) |
T |
findElementByLinkText(String using) |
T |
findElementByName(String using) |
T |
findElementByPartialLinkText(String using) |
T |
findElementByTagName(String using) |
T |
findElementByXPath(String using) |
List<RequiredElementType> |
findElementsByAndroidUIAutomator(String using) |
org.openqa.selenium.interactions.Mouse |
getMouse()
Deprecated.
|
NetworkConnectionSetting |
getNetworkConnection()
Get the current network settings of the device.
|
void |
ignoreUnimportantViews(Boolean compress)
Set the `ignoreUnimportantViews` setting.
|
boolean |
isLocked()
Check if the device is locked.
|
void |
longPressKeyCode(int key)
Send a long key event to the device
|
void |
longPressKeyCode(int key,
Integer metastate)
Send a long key event along with an Android metastate to an Android device
Metastates are things like *shift* to get uppercase characters
|
void |
openNotifications()
Open the notification shade, on Android devices.
|
void |
pressKeyCode(int key)
Send a key event to the device
|
void |
pressKeyCode(int key,
Integer metastate)
Send a key event along with an Android metastate to an Android device
Metastates are things like *shift* to get uppercase characters
|
void |
pushFile(String remotePath,
byte[] base64Data)
Save base64 encoded data as a file on the remote mobile device.
|
RequiredElementType |
scrollTo(String text)
Scroll forward to the element which has a description or name which contains the input text.
|
RequiredElementType |
scrollToExact(String text)
Scroll forward to the element which has a description or name which exactly matches the input text.
|
void |
setNetworkConnection(NetworkConnectionSetting connection)
Set the network connection of the device.
|
void |
startActivity(String appPackage,
String appActivity)
This method should start arbitrary activity during a test.
|
void |
startActivity(String appPackage,
String appActivity,
String appWaitPackage,
String appWaitActivity)
This method should start arbitrary activity during a test.
|
void |
toggleLocationServices() |
_isNotNullOrEmpty, _isNotNullOrEmpty, closeApp, context, execute, findElements, findElementsByAccessibilityId, findElementsByClassName, findElementsByCssSelector, findElementsById, findElementsByLinkText, findElementsByName, findElementsByPartialLinkText, findElementsByTagName, findElementsByXPath, getAppStrings, getAppStrings, getCommandImmutableMap, getCommandImmutableMap, getContext, getContextHandles, getExecuteMethod, getOrientation, getRemoteAddress, getSettings, hideKeyboard, installApp, isAppInstalled, launchApp, location, lockScreen, performMultiTouchAction, performTouchAction, pinch, pinch, pullFile, pullFolder, removeApp, resetApp, rotate, runAppInBackground, setLocation, setSetting, substituteMobilePlatform, swipe, tap, tap, zoom, zoomclose, executeAsyncScript, executeScript, findElement, findElements, get, getCapabilities, getCommandExecutor, getCurrentUrl, getElementConverter, getErrorHandler, getFileDetector, getKeyboard, getPageSource, getScreenshotAs, getSessionId, getTitle, getWindowHandle, getWindowHandles, log, manage, navigate, quit, setCommandExecutor, setElementConverter, setErrorHandler, setFileDetector, setFoundBy, setLogLevel, setSessionId, startClient, startSession, startSession, stopClient, switchTo, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waithideKeyboardpullFile, pullFolderpublic AndroidDriver(URL remoteAddress, org.openqa.selenium.Capabilities desiredCapabilities)
public AndroidDriver(AppiumDriverLocalService service, org.openqa.selenium.Capabilities desiredCapabilities)
public AndroidDriver(AppiumServiceBuilder builder, org.openqa.selenium.Capabilities desiredCapabilities)
public AndroidDriver(org.openqa.selenium.Capabilities desiredCapabilities)
public RequiredElementType scrollTo(String text)
scrollTo in interface ScrollsTo<org.openqa.selenium.WebElement>scrollTo in class AppiumDriver<RequiredElementType extends org.openqa.selenium.WebElement>text - public RequiredElementType scrollToExact(String text)
scrollToExact in interface ScrollsTo<org.openqa.selenium.WebElement>scrollToExact in class AppiumDriver<RequiredElementType extends org.openqa.selenium.WebElement>text - public void pressKeyCode(int key)
pressKeyCode in interface AndroidDeviceActionShortcutskey - code for the key pressed on the devicepublic void pressKeyCode(int key,
Integer metastate)
AndroidDeviceActionShortcutspressKeyCode in interface AndroidDeviceActionShortcutskey - code for the key pressed on the Android devicemetastate - metastate for the keypressAndroidKeyCode,
AndroidKeyMetastate,
AndroidDeviceActionShortcuts.pressKeyCode(int, Integer)public void longPressKeyCode(int key)
longPressKeyCode in interface AndroidDeviceActionShortcutskey - code for the long key pressed on the devicepublic void longPressKeyCode(int key,
Integer metastate)
AndroidDeviceActionShortcutslongPressKeyCode in interface AndroidDeviceActionShortcutskey - code for the long key pressed on the Android devicemetastate - metastate for the long key pressAndroidKeyCode,
AndroidKeyMetastate,
AndroidDeviceActionShortcuts.pressKeyCode(int, Integer)public NetworkConnectionSetting getNetworkConnection()
HasNetworkConnectiongetNetworkConnection in interface HasNetworkConnectionHasNetworkConnection.getNetworkConnection()public void setNetworkConnection(NetworkConnectionSetting connection)
HasNetworkConnectionsetNetworkConnection in interface HasNetworkConnectionconnection - The NetworkConnectionSetting configuration to use for the
deviceHasNetworkConnection.setNetworkConnection(NetworkConnectionSetting)public void pushFile(String remotePath, byte[] base64Data)
PushesFilespushFile in interface PushesFilesremotePath - Path to file to write data to on remote devicebase64Data - Base64 encoded byte array of data to write to remote devicePushesFiles.pushFile(String, byte[])public void startActivity(String appPackage, String appActivity, String appWaitPackage, String appWaitActivity) throws IllegalArgumentException
StartsActivitystartActivity in interface StartsActivityappPackage - The package containing the activity. [Required]appActivity - The activity to start. [Required]appWaitPackage - Automation will begin after this package starts. [Optional]appWaitActivity - Automation will begin after this activity starts. [Optional]IllegalArgumentExceptionStartsActivity.startActivity(String, String, String, String)public void startActivity(String appPackage, String appActivity) throws IllegalArgumentException
StartsActivitystartActivity in interface StartsActivityappPackage - The package containing the activity. [Required]appActivity - The activity to start. [Required]IllegalArgumentExceptionStartsActivity.startActivity(String, String)public void endTestCoverage(String intent, String path)
intent - intent to broadcastpath - path to .ec filepublic String currentActivity()
public void openNotifications()
public boolean isLocked()
public void toggleLocationServices()
public void ignoreUnimportantViews(Boolean compress)
compress - ignores unimportant views if true, doesn't ignore otherwise.public RequiredElementType findElementByAndroidUIAutomator(String using) throws org.openqa.selenium.WebDriverException
findElementByAndroidUIAutomator in interface FindsByAndroidUIAutomator<RequiredElementType extends org.openqa.selenium.WebElement>org.openqa.selenium.WebDriverException - This method is not applicable with browser/webview UI.public List<RequiredElementType> findElementsByAndroidUIAutomator(String using) throws org.openqa.selenium.WebDriverException
findElementsByAndroidUIAutomator in interface FindsByAndroidUIAutomator<RequiredElementType extends org.openqa.selenium.WebElement>org.openqa.selenium.WebDriverException - This method is not applicable with browser/webview UI.public org.openqa.selenium.remote.Response execute(String driverCommand, Map<String,?> parameters)
execute in interface MobileDriverexecute in class org.openqa.selenium.remote.RemoteWebDriverpublic T findElement(org.openqa.selenium.By by)
findElement in interface GenericSearchContext<T extends org.openqa.selenium.WebElement>findElement in interface org.openqa.selenium.SearchContextfindElement in interface org.openqa.selenium.WebDriverfindElement in class org.openqa.selenium.remote.RemoteWebDriverpublic T findElementById(String id)
findElementById in interface GenericFindsById<T extends org.openqa.selenium.WebElement>findElementById in interface org.openqa.selenium.internal.FindsByIdfindElementById in class org.openqa.selenium.remote.RemoteWebDriverpublic T findElementByLinkText(String using) throws org.openqa.selenium.WebDriverException
findElementByLinkText in interface GenericFindsByLinkText<T extends org.openqa.selenium.WebElement>findElementByLinkText in interface org.openqa.selenium.internal.FindsByLinkTextfindElementByLinkText in class org.openqa.selenium.remote.RemoteWebDriverorg.openqa.selenium.WebDriverException - his method doesn't work against native app UI.public T findElementByPartialLinkText(String using) throws org.openqa.selenium.WebDriverException
findElementByPartialLinkText in interface GenericFindsByLinkText<T extends org.openqa.selenium.WebElement>findElementByPartialLinkText in interface org.openqa.selenium.internal.FindsByLinkTextfindElementByPartialLinkText in class org.openqa.selenium.remote.RemoteWebDriverorg.openqa.selenium.WebDriverException - his method doesn't work against native app UI.public T findElementByTagName(String using)
findElementByTagName in interface GenericFindsByTagName<T extends org.openqa.selenium.WebElement>findElementByTagName in interface org.openqa.selenium.internal.FindsByTagNamefindElementByTagName in class org.openqa.selenium.remote.RemoteWebDriverpublic T findElementByName(String using)
findElementByName in interface GenericFindsByName<T extends org.openqa.selenium.WebElement>findElementByName in interface org.openqa.selenium.internal.FindsByNamefindElementByName in class org.openqa.selenium.remote.RemoteWebDriverpublic T findElementByClassName(String using)
findElementByClassName in interface GenericFindsByClassName<T extends org.openqa.selenium.WebElement>findElementByClassName in interface org.openqa.selenium.internal.FindsByClassNamefindElementByClassName in class org.openqa.selenium.remote.RemoteWebDriverpublic T findElementByCssSelector(String using) throws org.openqa.selenium.WebDriverException
findElementByCssSelector in interface GenericFindsByCssSelector<T extends org.openqa.selenium.WebElement>findElementByCssSelector in interface org.openqa.selenium.internal.FindsByCssSelectorfindElementByCssSelector in class org.openqa.selenium.remote.RemoteWebDriverorg.openqa.selenium.WebDriverException - his method doesn't work against native app UI.public T findElementByXPath(String using)
findElementByXPath in interface GenericFindsByXPath<T extends org.openqa.selenium.WebElement>findElementByXPath in interface org.openqa.selenium.internal.FindsByXPathfindElementByXPath in class org.openqa.selenium.remote.RemoteWebDriverpublic T findElementByAccessibilityId(String using) throws org.openqa.selenium.WebDriverException
findElementByAccessibilityId in interface FindsByAccessibilityId<org.openqa.selenium.WebElement>org.openqa.selenium.WebDriverException@Deprecated public org.openqa.selenium.interactions.Mouse getMouse()
getMouse in interface org.openqa.selenium.interactions.HasInputDevicesgetMouse in class org.openqa.selenium.remote.RemoteWebDriverCopyright © 2015. All rights reserved.