public abstract class MobileElement extends org.openqa.selenium.remote.RemoteWebElement implements FindsByAccessibilityId, TouchableElement
Modifier and Type | Field and Description |
---|---|
protected org.openqa.selenium.remote.FileDetector |
fileDetector |
Constructor and Description |
---|
MobileElement() |
Modifier and Type | Method and Description |
---|---|
org.openqa.selenium.WebElement |
findElement(org.openqa.selenium.By by) |
org.openqa.selenium.WebElement |
findElementByAccessibilityId(String using) |
List<org.openqa.selenium.WebElement> |
findElements(org.openqa.selenium.By by) |
List<org.openqa.selenium.WebElement> |
findElementsByAccessibilityId(String using) |
org.openqa.selenium.Point |
getCenter() |
void |
pinch()
Convenience method for pinching the given element.
|
void |
swipe(SwipeElementDirection direction,
int duration)
Convenience method for swiping on the given element to the given direction
|
void |
swipe(SwipeElementDirection direction,
int offsetFromStartBorder,
int offsetFromEndBorder,
int duration)
Convenience method for swiping on the given element to the given direction
|
void |
tap(int fingers,
int duration)
Convenience method for tapping the center of the given element
|
void |
zoom()
Convenience method for "zooming in" on the given element.
|
clear, click, equals, execute, findElement, findElementByClassName, findElementByCssSelector, findElementById, findElementByLinkText, findElementByName, findElementByPartialLinkText, findElementByTagName, findElementByXPath, findElements, findElementsByClassName, findElementsByCssSelector, findElementsById, findElementsByLinkText, findElementsByName, findElementsByPartialLinkText, findElementsByTagName, findElementsByXPath, getAttribute, getCoordinates, getCssValue, getId, getLocation, getSize, getTagName, getText, getWrappedDriver, hashCode, isDisplayed, isEnabled, isSelected, sendKeys, setFileDetector, setFoundBy, setId, setParent, submit, toString
public List<org.openqa.selenium.WebElement> findElements(org.openqa.selenium.By by)
findElements
in interface org.openqa.selenium.SearchContext
findElements
in interface org.openqa.selenium.WebElement
findElements
in class org.openqa.selenium.remote.RemoteWebElement
public org.openqa.selenium.WebElement findElement(org.openqa.selenium.By by)
findElement
in interface org.openqa.selenium.SearchContext
findElement
in interface org.openqa.selenium.WebElement
findElement
in class org.openqa.selenium.remote.RemoteWebElement
public org.openqa.selenium.WebElement findElementByAccessibilityId(String using)
findElementByAccessibilityId
in interface FindsByAccessibilityId
public List<org.openqa.selenium.WebElement> findElementsByAccessibilityId(String using)
findElementsByAccessibilityId
in interface FindsByAccessibilityId
public org.openqa.selenium.Point getCenter()
public void pinch()
TouchableElement
pinch
in interface TouchableElement
public void tap(int fingers, int duration)
TouchableElement
tap
in interface TouchableElement
fingers
- number of fingers/appendages to tap withduration
- how long between pressing down, and lifting fingers/appendagespublic void zoom()
TouchableElement
zoom
in interface TouchableElement
public void swipe(SwipeElementDirection direction, int duration)
TouchableElement
swipe
in interface TouchableElement
direction
- UP, DOWN, LEFT, RIGHTduration
- amount of time in milliseconds for the entire swipe action to
takepublic void swipe(SwipeElementDirection direction, int offsetFromStartBorder, int offsetFromEndBorder, int duration) throws IllegalCoordinatesException
TouchableElement
swipe
in interface TouchableElement
direction
- direction UP, DOWN, LEFT, RIGHToffsetFromEndBorder
- is the offset from the border of the element where the swiping should be started.
If direction is UP then
this is offset from the bottom of the element. If direction is DOWN then
this is offset from the top of the element. If direction is RIGHT then
this is offset from the left border of the element. If direction is LEFT then
this is offset from the right border of the element.duration
- amount of time in milliseconds for the entire swipe action to
takeIllegalCoordinatesException
- when resulted coordinates are out of the element borders
or disagree with the given directionCopyright © 2015. All rights reserved.