T - the required type of class which implement WebElement.
Instances of the defined type will be returned via findElement* and findElements*
Warning (!!!). Allowed types:
WebElement
TouchableElement
RemoteWebElement
MobileElement and its subclasses that designed
specifically
for each target mobile OS (still Android and iOS)public abstract class AppiumDriver<T extends WebElement>
extends org.openqa.selenium.remote.RemoteWebDriver
org.openqa.selenium.remote.RemoteWebDriver.RemoteTargetLocator, org.openqa.selenium.remote.RemoteWebDriver.RemoteWebDriverOptions, org.openqa.selenium.remote.RemoteWebDriver.WhenWebDriver.ImeHandler, WebDriver.Navigation, WebDriver.Options, WebDriver.TargetLocator, WebDriver.Timeouts, WebDriver.Window| Modifier | Constructor and Description |
|---|---|
|
AppiumDriver(AppiumDriverLocalService service,
org.openqa.selenium.Capabilities desiredCapabilities,
Class<? extends org.openqa.selenium.remote.internal.JsonToWebElementConverter> converterClazz) |
|
AppiumDriver(AppiumDriverLocalService service,
org.openqa.selenium.remote.http.HttpClient.Factory httpClientFactory,
org.openqa.selenium.Capabilities desiredCapabilities,
Class<? extends org.openqa.selenium.remote.internal.JsonToWebElementConverter> converterClazz) |
|
AppiumDriver(AppiumServiceBuilder builder,
org.openqa.selenium.Capabilities desiredCapabilities,
Class<? extends org.openqa.selenium.remote.internal.JsonToWebElementConverter> converterClazz) |
|
AppiumDriver(AppiumServiceBuilder builder,
org.openqa.selenium.remote.http.HttpClient.Factory httpClientFactory,
org.openqa.selenium.Capabilities desiredCapabilities,
Class<? extends org.openqa.selenium.remote.internal.JsonToWebElementConverter> converterClazz) |
|
AppiumDriver(org.openqa.selenium.Capabilities desiredCapabilities,
Class<? extends org.openqa.selenium.remote.internal.JsonToWebElementConverter> converterClazz) |
|
AppiumDriver(org.openqa.selenium.remote.http.HttpClient.Factory httpClientFactory,
org.openqa.selenium.Capabilities desiredCapabilities,
Class<? extends org.openqa.selenium.remote.internal.JsonToWebElementConverter> converterClazz) |
protected |
AppiumDriver(org.openqa.selenium.remote.HttpCommandExecutor executor,
org.openqa.selenium.Capabilities capabilities,
Class<? extends org.openqa.selenium.remote.internal.JsonToWebElementConverter> converterClazz) |
|
AppiumDriver(URL remoteAddress,
org.openqa.selenium.Capabilities desiredCapabilities,
Class<? extends org.openqa.selenium.remote.internal.JsonToWebElementConverter> converterClazz) |
|
AppiumDriver(URL remoteAddress,
org.openqa.selenium.remote.http.HttpClient.Factory httpClientFactory,
org.openqa.selenium.Capabilities desiredCapabilities,
Class<? extends org.openqa.selenium.remote.internal.JsonToWebElementConverter> converterClazz) |
| Modifier and Type | Method and Description |
|---|---|
void |
closeApp()
Close the app which was provided in the capabilities at session creation.
|
WebDriver |
context(String name) |
protected void |
doSwipe(int startx,
int starty,
int endx,
int endy,
int duration) |
protected org.openqa.selenium.remote.Response |
execute(String command) |
org.openqa.selenium.remote.Response |
execute(String driverCommand,
Map<String,?> parameters) |
T |
findElement(org.openqa.selenium.By by)
Find the first
WebElement using the given method. |
T |
findElement(String by,
String using) |
T |
findElementByAccessibilityId(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<T> |
findElements(org.openqa.selenium.By by)
Find all elements within the current page using the given mechanism.
|
List<T> |
findElements(String by,
String using) |
List<T> |
findElementsByAccessibilityId(String using) |
List<T> |
findElementsByClassName(String using) |
List<T> |
findElementsByCssSelector(String using) |
List<T> |
findElementsById(String id) |
List<T> |
findElementsByLinkText(String using) |
List<T> |
findElementsByName(String using) |
List<T> |
findElementsByPartialLinkText(String using) |
List<T> |
findElementsByTagName(String using) |
List<T> |
findElementsByXPath(String using) |
Map<String,String> |
getAppStringMap()
Get all defined Strings from an app for the default language.
|
Map<String,String> |
getAppStringMap(String language)
Get all defined Strings from an app for the specified language.
|
Map<String,String> |
getAppStringMap(String language,
String stringFile)
Get all defined Strings from an app for the specified language and
strings filename.
|
String |
getContext() |
Set<String> |
getContextHandles() |
String |
getDeviceTime() |
org.openqa.selenium.remote.ExecuteMethod |
getExecuteMethod() |
org.openqa.selenium.interactions.Mouse |
getMouse()
Deprecated.
|
org.openqa.selenium.ScreenOrientation |
getOrientation() |
URL |
getRemoteAddress() |
Map<String,Object> |
getSessionDetails() |
com.google.gson.JsonObject |
getSettings()
Get settings stored for this test session It's probably better to use a
convenience function, rather than use this function directly.
|
void |
hideKeyboard()
Hides the keyboard if it is showing.
|
void |
installApp(String appPath)
Install an app on the mobile device.
|
boolean |
isAppInstalled(String bundleId)
Checks if an app is installed on the device.
|
void |
launchApp()
Launch the app which was provided in the capabilities at session creation.
|
org.openqa.selenium.html5.Location |
location() |
void |
performMultiTouchAction(MultiTouchAction multiAction)
Performs multiple TouchAction gestures at the same time, to simulate
multiple fingers/touch inputs.
|
TouchAction |
performTouchAction(TouchAction touchAction)
Performs a chain of touch actions, which together can be considered an
entire gesture.
|
void |
pinch(int x,
int y)
Convenience method for pinching an element on the screen.
|
void |
pinch(WebElement el)
Convenience method for pinching an element on the screen.
|
byte[] |
pullFile(String remotePath) |
byte[] |
pullFolder(String remotePath)
Pull a folder from the simulator/device.
|
void |
removeApp(String bundleId)
Remove the specified app from the device (uninstall).
|
void |
resetApp()
Reset the currently running app for this session.
|
void |
rotate(org.openqa.selenium.ScreenOrientation orientation) |
void |
runAppInBackground(int seconds)
Runs the current app as a background app for the number of seconds
requested.
|
void |
setLocation(org.openqa.selenium.html5.Location location) |
protected void |
setSetting(AppiumSetting setting,
Object value)
Set a setting for this test session It's probably better to use a
convenience function, rather than use this function directly.
|
protected static org.openqa.selenium.Capabilities |
substituteMobilePlatform(org.openqa.selenium.Capabilities originalCapabilities,
String newPlatform) |
abstract void |
swipe(int startx,
int starty,
int endx,
int endy,
int duration)
Convenience method for swiping across the screen.
|
void |
tap(int fingers,
int x,
int y,
int duration)
Convenience method for tapping a position on the screen.
|
void |
tap(int fingers,
WebElement element,
int duration)
Convenience method for tapping the center of an element on the screen.
|
void |
zoom(int x,
int y)
Convenience method for "zooming in" on an element on the screen.
|
void |
zoom(WebElement el)
Convenience method for "zooming in" on an element on the screen.
|
close, executeAsyncScript, executeScript, get, getCapabilities, getCommandExecutor, getCurrentUrl, getElementConverter, getErrorHandler, getFileDetector, getKeyboard, getPageSource, getScreenshotAs, getSessionId, getTitle, getW3CStandardComplianceLevel, 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, waitclose, get, getCurrentUrl, getPageSource, getTitle, getWindowHandle, getWindowHandles, manage, navigate, quit, switchToprotected AppiumDriver(org.openqa.selenium.remote.HttpCommandExecutor executor,
org.openqa.selenium.Capabilities capabilities,
Class<? extends org.openqa.selenium.remote.internal.JsonToWebElementConverter> converterClazz)
executor - is an instance of HttpCommandExecutor
or class that extends it. Default commands or another vendor-specific
commands may be specified there.capabilities - take a look
at CapabilitiesconverterClazz - is an instance of a class that extends
JsonToWebElementConverter. It converts
JSON response to an instance of
WebElementpublic AppiumDriver(URL remoteAddress, org.openqa.selenium.Capabilities desiredCapabilities, Class<? extends org.openqa.selenium.remote.internal.JsonToWebElementConverter> converterClazz)
public AppiumDriver(URL remoteAddress, org.openqa.selenium.remote.http.HttpClient.Factory httpClientFactory, org.openqa.selenium.Capabilities desiredCapabilities, Class<? extends org.openqa.selenium.remote.internal.JsonToWebElementConverter> converterClazz)
public AppiumDriver(AppiumDriverLocalService service, org.openqa.selenium.Capabilities desiredCapabilities, Class<? extends org.openqa.selenium.remote.internal.JsonToWebElementConverter> converterClazz)
public AppiumDriver(AppiumDriverLocalService service, org.openqa.selenium.remote.http.HttpClient.Factory httpClientFactory, org.openqa.selenium.Capabilities desiredCapabilities, Class<? extends org.openqa.selenium.remote.internal.JsonToWebElementConverter> converterClazz)
public AppiumDriver(AppiumServiceBuilder builder, org.openqa.selenium.Capabilities desiredCapabilities, Class<? extends org.openqa.selenium.remote.internal.JsonToWebElementConverter> converterClazz)
public AppiumDriver(AppiumServiceBuilder builder, org.openqa.selenium.remote.http.HttpClient.Factory httpClientFactory, org.openqa.selenium.Capabilities desiredCapabilities, Class<? extends org.openqa.selenium.remote.internal.JsonToWebElementConverter> converterClazz)
public AppiumDriver(org.openqa.selenium.remote.http.HttpClient.Factory httpClientFactory,
org.openqa.selenium.Capabilities desiredCapabilities,
Class<? extends org.openqa.selenium.remote.internal.JsonToWebElementConverter> converterClazz)
public AppiumDriver(org.openqa.selenium.Capabilities desiredCapabilities,
Class<? extends org.openqa.selenium.remote.internal.JsonToWebElementConverter> converterClazz)
protected static org.openqa.selenium.Capabilities substituteMobilePlatform(org.openqa.selenium.Capabilities originalCapabilities,
String newPlatform)
originalCapabilities - the given Capabilities.newPlatform - a MobileCapabilityType.PLATFORM_NAME value which has
to be set upCapabilities with changed mobile platform valuepublic List<T> findElements(org.openqa.selenium.By by)
WebDriverfindElements in interface MobileDriver<T extends WebElement>findElements in interface SearchContextfindElements in interface WebDriverby - The locating mechanism to useWebElements, or an empty list if nothing matchesBy,
WebDriver.Timeoutspublic List<T> findElementsById(String id)
findElementsById in interface MobileDriver<T extends WebElement>findElementsById in interface FindsByIdpublic List<T> findElementsByLinkText(String using)
findElementsByLinkText in interface MobileDriver<T extends WebElement>findElementsByLinkText in interface FindsByLinkTextpublic List<T> findElementsByPartialLinkText(String using)
findElementsByPartialLinkText in interface MobileDriver<T extends WebElement>findElementsByPartialLinkText in interface FindsByLinkTextpublic List<T> findElementsByTagName(String using)
findElementsByTagName in interface MobileDriver<T extends WebElement>findElementsByTagName in interface FindsByTagNamepublic List<T> findElementsByName(String using)
findElementsByName in interface MobileDriver<T extends WebElement>findElementsByName in interface FindsByNamepublic List<T> findElementsByClassName(String using)
findElementsByClassName in interface MobileDriver<T extends WebElement>findElementsByClassName in interface FindsByClassNamepublic List<T> findElementsByCssSelector(String using)
findElementsByCssSelector in interface MobileDriver<T extends WebElement>findElementsByCssSelector in interface FindsByCssSelectorpublic List<T> findElementsByXPath(String using)
findElementsByXPath in interface MobileDriver<T extends WebElement>findElementsByXPath in interface FindsByXPathpublic List<T> findElementsByAccessibilityId(String using)
findElementsByAccessibilityId in interface FindsByAccessibilityId<T extends WebElement>protected org.openqa.selenium.remote.Response execute(String command)
execute in class org.openqa.selenium.remote.RemoteWebDriverpublic org.openqa.selenium.remote.ExecuteMethod getExecuteMethod()
getExecuteMethod in class org.openqa.selenium.remote.RemoteWebDriverpublic void resetApp()
InteractsWithAppsInteractsWithApps.resetApp().public boolean isAppInstalled(String bundleId)
InteractsWithAppsbundleId - bundleId of the app.InteractsWithApps.isAppInstalled(String).public void installApp(String appPath)
InteractsWithAppsappPath - path to app to install.InteractsWithApps.installApp(String).public void removeApp(String bundleId)
InteractsWithAppsbundleId - the bunble identifier (or app id) of the app to remove.InteractsWithApps.removeApp(String).public void launchApp()
InteractsWithAppsInteractsWithApps.launchApp().public void closeApp()
InteractsWithAppsInteractsWithApps.closeApp().public void runAppInBackground(int seconds)
InteractsWithAppsseconds - Number of seconds to run App in background.InteractsWithApps.runAppInBackground(int).public String getDeviceTime()
public void hideKeyboard()
DeviceActionShortcutspublic byte[] pullFile(String remotePath)
remotePath - On Android and iOS, this is either the path to the file
(relative to the root of the app's file system). On iOS only,
if path starts with /AppName.app, which will be replaced with
the application's .app directoryInteractsWithFiles.pullFile(String).public byte[] pullFolder(String remotePath)
InteractsWithFilesremotePath - On Android and iOS, this is either the path to the file
(relative to the root of the app's file system). On iOS only,
if path starts with /AppName.app, which will be replaced with
the application's .app directoryInteractsWithFiles.pullFolder(String).public TouchAction performTouchAction(TouchAction touchAction)
PerformsTouchActionstouchAction - A TouchAction object, which contains a list of individual
touch actions to performPerformsTouchActions.performTouchAction(TouchAction).public void performMultiTouchAction(MultiTouchAction multiAction)
PerformsTouchActionsmultiAction - the MultiTouchAction object to perform.PerformsTouchActions.performMultiTouchAction(MultiTouchAction).public void tap(int fingers,
WebElement element,
int duration)
TouchShortcutsfingers - number of fingers/appendages to tap with.element - element to tap.duration - how long between pressing down, and lifting fingers/appendages.TouchShortcuts.tap(int, WebElement, int).public void tap(int fingers,
int x,
int y,
int duration)
TouchShortcutsfingers - number of fingers/appendages to tap with.x - x coordinate.y - y coordinate.duration - how long between pressing down, and lifting fingers/appendages.TouchShortcuts.tap(int, int, int, int).protected void doSwipe(int startx,
int starty,
int endx,
int endy,
int duration)
public abstract void swipe(int startx,
int starty,
int endx,
int endy,
int duration)
TouchShortcutsstartx - starting x coordinate.starty - starting y coordinate.endx - ending x coordinate.endy - ending y coordinate.duration - amount of time in milliseconds for the entire swipe action to takeTouchShortcuts.swipe(int, int, int, int, int).public void pinch(WebElement el)
el - The element to pinch.public void pinch(int x,
int y)
x - x coordinate to terminate the pinch on.y - y coordinate to terminate the pinch on.public void zoom(WebElement el)
el - The element to pinch.public void zoom(int x,
int y)
x - x coordinate to start zoom on.y - y coordinate to start zoom on.public com.google.gson.JsonObject getSettings()
protected void setSetting(AppiumSetting setting, Object value)
setting - AppiumSetting you wish to set.value - value of the setting.public String getContext()
public void rotate(org.openqa.selenium.ScreenOrientation orientation)
public org.openqa.selenium.ScreenOrientation getOrientation()
public org.openqa.selenium.html5.Location location()
public void setLocation(org.openqa.selenium.html5.Location location)
public Map<String,String> getAppStringMap()
HasAppStringsHasAppStrings.getAppStringMap().public Map<String,String> getAppStringMap(String language)
HasAppStringslanguage - strings language code.HasAppStrings.getAppStringMap(String).public Map<String,String> getAppStringMap(String language, String stringFile)
HasAppStringslanguage - strings language code.stringFile - strings filename.HasAppStrings.getAppStringMap(String, String).public URL getRemoteAddress()
public Map<String,Object> getSessionDetails()
public org.openqa.selenium.remote.Response execute(String driverCommand, Map<String,?> parameters)
execute in interface MobileDriver<T extends WebElement>execute in class org.openqa.selenium.remote.RemoteWebDriverpublic T findElement(org.openqa.selenium.By by)
WebDriverWebElement using the given method.
This method is affected by the 'implicit wait' times in force at the time of execution.
The findElement(..) invocation will return a matching row, or try again repeatedly until
the configured timeout is reached.
findElement should not be used to look for non-present elements, use WebDriver.findElements(By)
and assert zero length response instead.
findElement in interface MobileDriver<T extends WebElement>findElement in interface SearchContextfindElement in interface WebDriverfindElement in class org.openqa.selenium.remote.RemoteWebDriverby - The locating mechanismBy,
WebDriver.Timeoutspublic T findElement(String by, String using)
findElement in class org.openqa.selenium.remote.RemoteWebDriverpublic T findElementById(String id)
findElementById in interface MobileDriver<T extends WebElement>findElementById in interface FindsByIdfindElementById in class org.openqa.selenium.remote.RemoteWebDriverpublic T findElementByLinkText(String using) throws org.openqa.selenium.WebDriverException
findElementByLinkText in interface MobileDriver<T extends WebElement>findElementByLinkText in interface 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 MobileDriver<T extends WebElement>findElementByPartialLinkText in interface 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 MobileDriver<T extends WebElement>findElementByTagName in interface FindsByTagNamefindElementByTagName in class org.openqa.selenium.remote.RemoteWebDriverpublic T findElementByName(String using)
findElementByName in interface MobileDriver<T extends WebElement>findElementByName in interface FindsByNamefindElementByName in class org.openqa.selenium.remote.RemoteWebDriverpublic T findElementByClassName(String using)
findElementByClassName in interface MobileDriver<T extends WebElement>findElementByClassName in interface FindsByClassNamefindElementByClassName in class org.openqa.selenium.remote.RemoteWebDriverpublic T findElementByCssSelector(String using) throws org.openqa.selenium.WebDriverException
findElementByCssSelector in interface MobileDriver<T extends WebElement>findElementByCssSelector in interface 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 MobileDriver<T extends WebElement>findElementByXPath in interface FindsByXPathfindElementByXPath in class org.openqa.selenium.remote.RemoteWebDriverpublic T findElementByAccessibilityId(String using) throws org.openqa.selenium.WebDriverException
findElementByAccessibilityId in interface FindsByAccessibilityId<T extends WebElement>org.openqa.selenium.WebDriverException - This method is not applicable with browser/webview UI.@Deprecated public org.openqa.selenium.interactions.Mouse getMouse()
getMouse in interface org.openqa.selenium.interactions.HasInputDevicesgetMouse in class org.openqa.selenium.remote.RemoteWebDriverCopyright © 2016. All rights reserved.