public abstract class MobileElement
extends org.openqa.selenium.remote.RemoteWebElement
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.remote.Response |
execute(String driverCommand,
Map<String,?> parameters) |
T |
findElement(org.openqa.selenium.By by) |
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<MobileElement> |
findElements(org.openqa.selenium.By by) |
List<MobileElement> |
findElementsByAccessibilityId(String using) |
List<MobileElement> |
findElementsByClassName(String using) |
List<MobileElement> |
findElementsByCssSelector(String using) |
List<MobileElement> |
findElementsById(String id) |
List<MobileElement> |
findElementsByLinkText(String using) |
List<MobileElement> |
findElementsByName(String using) |
List<MobileElement> |
findElementsByPartialLinkText(String using) |
List<MobileElement> |
findElementsByTagName(String using) |
List<MobileElement> |
findElementsByXPath(String using) |
org.openqa.selenium.Point |
getCenter() |
String |
getCssValue(String propertyName) |
void |
pinch()
Convenience method for pinching the given element.
|
void |
submit() |
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, findElement, findElements, getAttribute, getCoordinates, getId, getLocation, getRect, getScreenshotAs, getSize, getTagName, getText, getWrappedDriver, hashCode, isDisplayed, isEnabled, isSelected, sendKeys, setFileDetector, setFoundBy, setId, setParent, toString
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
public org.openqa.selenium.Point getCenter()
public void pinch()
TouchableElement
public void tap(int fingers, int duration)
TouchableElement
fingers
- number of fingers/appendages to tap withduration
- how long between pressing down, and lifting fingers/appendagespublic void zoom()
TouchableElement
public void swipe(SwipeElementDirection direction, int duration)
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
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 directionpublic List<MobileElement> findElements(org.openqa.selenium.By by)
findElements
in interface GenericSearchContext<MobileElement>
findElements
in interface org.openqa.selenium.SearchContext
findElements
in interface org.openqa.selenium.WebElement
public List<MobileElement> findElementsById(String id)
findElementsById
in interface GenericFindsById<MobileElement>
findElementsById
in interface org.openqa.selenium.internal.FindsById
public List<MobileElement> findElementsByLinkText(String using)
findElementsByLinkText
in interface GenericFindsByLinkText<MobileElement>
findElementsByLinkText
in interface org.openqa.selenium.internal.FindsByLinkText
public List<MobileElement> findElementsByPartialLinkText(String using)
findElementsByPartialLinkText
in interface GenericFindsByLinkText<MobileElement>
findElementsByPartialLinkText
in interface org.openqa.selenium.internal.FindsByLinkText
public List<MobileElement> findElementsByTagName(String using)
findElementsByTagName
in interface GenericFindsByTagName<MobileElement>
findElementsByTagName
in interface org.openqa.selenium.internal.FindsByTagName
public List<MobileElement> findElementsByName(String using)
findElementsByName
in interface GenericFindsByName<MobileElement>
findElementsByName
in interface org.openqa.selenium.internal.FindsByName
public List<MobileElement> findElementsByClassName(String using)
findElementsByClassName
in interface GenericFindsByClassName<MobileElement>
findElementsByClassName
in interface org.openqa.selenium.internal.FindsByClassName
public List<MobileElement> findElementsByCssSelector(String using)
findElementsByCssSelector
in interface GenericFindsByCssSelector<MobileElement>
findElementsByCssSelector
in interface org.openqa.selenium.internal.FindsByCssSelector
public List<MobileElement> findElementsByXPath(String using)
findElementsByXPath
in interface GenericFindsByXPath<MobileElement>
findElementsByXPath
in interface org.openqa.selenium.internal.FindsByXPath
public List<MobileElement> findElementsByAccessibilityId(String using)
findElementsByAccessibilityId
in interface FindsByAccessibilityId<MobileElement>
public org.openqa.selenium.remote.Response execute(String driverCommand, Map<String,?> parameters)
execute
in class org.openqa.selenium.remote.RemoteWebElement
public T findElement(org.openqa.selenium.By by)
findElement
in interface GenericSearchContext<T extends org.openqa.selenium.WebElement>
findElement
in interface org.openqa.selenium.SearchContext
findElement
in interface org.openqa.selenium.WebElement
findElement
in class org.openqa.selenium.remote.RemoteWebElement
public T findElementById(String id)
findElementById
in interface GenericFindsById<T extends org.openqa.selenium.WebElement>
findElementById
in interface org.openqa.selenium.internal.FindsById
findElementById
in class org.openqa.selenium.remote.RemoteWebElement
public 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.FindsByLinkText
findElementByLinkText
in class org.openqa.selenium.remote.RemoteWebElement
org.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.FindsByLinkText
findElementByPartialLinkText
in class org.openqa.selenium.remote.RemoteWebElement
org.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.FindsByTagName
findElementByTagName
in class org.openqa.selenium.remote.RemoteWebElement
public T findElementByName(String using)
findElementByName
in interface GenericFindsByName<T extends org.openqa.selenium.WebElement>
findElementByName
in interface org.openqa.selenium.internal.FindsByName
findElementByName
in class org.openqa.selenium.remote.RemoteWebElement
public T findElementByClassName(String using)
findElementByClassName
in interface GenericFindsByClassName<T extends org.openqa.selenium.WebElement>
findElementByClassName
in interface org.openqa.selenium.internal.FindsByClassName
findElementByClassName
in class org.openqa.selenium.remote.RemoteWebElement
public 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.FindsByCssSelector
findElementByCssSelector
in class org.openqa.selenium.remote.RemoteWebElement
org.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.FindsByXPath
findElementByXPath
in class org.openqa.selenium.remote.RemoteWebElement
public T findElementByAccessibilityId(String using)
findElementByAccessibilityId
in interface FindsByAccessibilityId<T extends org.openqa.selenium.WebElement>
public void submit() throws org.openqa.selenium.WebDriverException
submit
in interface org.openqa.selenium.WebElement
submit
in class org.openqa.selenium.remote.RemoteWebElement
org.openqa.selenium.WebDriverException
- because it may not work against native app UI.public String getCssValue(String propertyName) throws org.openqa.selenium.WebDriverException
getCssValue
in interface org.openqa.selenium.WebElement
getCssValue
in class org.openqa.selenium.remote.RemoteWebElement
org.openqa.selenium.WebDriverException
- because it may not work against native app UI.Copyright © 2016. All rights reserved.