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)
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<MobileElement> |
findElements(org.openqa.selenium.By by)
Find all elements within the current context using the given mechanism.
|
List<MobileElement> |
findElements(String by,
String using) |
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()
Method returns central coordinates of an element.
|
String |
getCssValue(String propertyName)
Get the value of a given CSS property.
|
void |
pinch()
Convenience method for pinching the given element.
|
void |
setValue(String value)
This method sets the new value of the attribute "value".
|
void |
submit()
If this current element is a form, or an element within a form, then this will be submitted to
the remote server.
|
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, getAttribute, getCoordinates, getId, getLocation, getRect, getScreenshotAs, getSize, getTagName, getText, getWrappedDriver, hashCode, isDisplayed, isEnabled, isSelected, sendKeys, setFileDetector, setFoundBy, setId, setParent, toStringclone, finalize, getClass, notify, notifyAll, wait, wait, waitclear, click, getAttribute, getLocation, getRect, getSize, getTagName, getText, isDisplayed, isEnabled, isSelected, sendKeyspublic org.openqa.selenium.Point getCenter()
Pointpublic void pinch()
TouchableElementpublic void tap(int fingers,
int duration)
TouchableElementfingers - number of fingers/appendages to tap with.duration - how long between pressing down, and lifting fingers/appendages.public void zoom()
TouchableElementpublic void swipe(SwipeElementDirection direction, int duration)
TouchableElementdirection - UP, DOWN, LEFT, RIGHT.duration - amount of time in milliseconds for the entire swipe action to
take.public void swipe(SwipeElementDirection direction, int offsetFromStartBorder, int offsetFromEndBorder, int duration) throws IllegalCoordinatesException
TouchableElementdirection - direction UP, DOWN, LEFT, RIGHT.offsetFromStartBorder - 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.offsetFromEndBorder - is the offset from the border of the element where
the swiping should be finished. If direction is UP then
this is offset from the top of the element.
If direction is DOWN then this is offset from the bottom
of the element. If direction is RIGHT then
this is offset from the right border of the element.
If direction is LEFT then this is offset from the
left border of the element.duration - amount of time in milliseconds for the entire swipe action to
take.IllegalCoordinatesException - when resulted coordinates are out of the
element borders or disagree with the given direction.public List<MobileElement> findElements(org.openqa.selenium.By by)
WebElementfindElements in interface TouchableElement<MobileElement>findElements in interface SearchContextfindElements in interface WebElementby - The locating mechanism to useWebElements, or an empty list if nothing matches.By,
WebDriver.Timeoutspublic List<MobileElement> findElements(String by, String using)
public List<MobileElement> findElementsById(String id)
findElementsById in interface TouchableElement<MobileElement>findElementsById in interface FindsByIdpublic List<MobileElement> findElementsByLinkText(String using)
findElementsByLinkText in interface TouchableElement<MobileElement>findElementsByLinkText in interface FindsByLinkTextpublic List<MobileElement> findElementsByPartialLinkText(String using)
findElementsByPartialLinkText in interface TouchableElement<MobileElement>findElementsByPartialLinkText in interface FindsByLinkTextpublic List<MobileElement> findElementsByTagName(String using)
findElementsByTagName in interface TouchableElement<MobileElement>findElementsByTagName in interface FindsByTagNamepublic List<MobileElement> findElementsByName(String using)
findElementsByName in interface TouchableElement<MobileElement>findElementsByName in interface FindsByNamepublic List<MobileElement> findElementsByClassName(String using)
findElementsByClassName in interface TouchableElement<MobileElement>findElementsByClassName in interface FindsByClassNamepublic List<MobileElement> findElementsByCssSelector(String using)
findElementsByCssSelector in interface TouchableElement<MobileElement>findElementsByCssSelector in interface FindsByCssSelectorpublic List<MobileElement> findElementsByXPath(String using)
findElementsByXPath in interface TouchableElement<MobileElement>findElementsByXPath in interface FindsByXPathpublic List<MobileElement> findElementsByAccessibilityId(String using)
findElementsByAccessibilityId in interface FindsByAccessibilityId<MobileElement>public void setValue(String value)
value - is the new value which should be setpublic org.openqa.selenium.remote.Response execute(String driverCommand, Map<String,?> parameters)
execute in class org.openqa.selenium.remote.RemoteWebElementpublic T findElement(org.openqa.selenium.By by)
WebElementWebElement using the given method. See the note in
WebElement.findElements(By) about finding via XPath.
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 WebElement.findElements(By)
and assert zero length response instead.
findElement in interface TouchableElement<T extends WebElement>findElement in interface SearchContextfindElement in interface WebElementfindElement in class org.openqa.selenium.remote.RemoteWebElementby - The locating mechanismBy,
WebDriver.Timeoutspublic T findElement(String by, String using)
findElement in class org.openqa.selenium.remote.RemoteWebElementpublic T findElementById(String id)
findElementById in interface TouchableElement<T extends WebElement>findElementById in interface FindsByIdfindElementById in class org.openqa.selenium.remote.RemoteWebElementpublic T findElementByLinkText(String using) throws org.openqa.selenium.WebDriverException
findElementByLinkText in interface TouchableElement<T extends WebElement>findElementByLinkText in interface FindsByLinkTextfindElementByLinkText in class org.openqa.selenium.remote.RemoteWebElementorg.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 TouchableElement<T extends WebElement>findElementByPartialLinkText in interface FindsByLinkTextfindElementByPartialLinkText in class org.openqa.selenium.remote.RemoteWebElementorg.openqa.selenium.WebDriverException - his method doesn't work against native app UI.public T findElementByTagName(String using)
findElementByTagName in interface TouchableElement<T extends WebElement>findElementByTagName in interface FindsByTagNamefindElementByTagName in class org.openqa.selenium.remote.RemoteWebElementpublic T findElementByName(String using)
findElementByName in interface TouchableElement<T extends WebElement>findElementByName in interface FindsByNamefindElementByName in class org.openqa.selenium.remote.RemoteWebElementpublic T findElementByClassName(String using)
findElementByClassName in interface TouchableElement<T extends WebElement>findElementByClassName in interface FindsByClassNamefindElementByClassName in class org.openqa.selenium.remote.RemoteWebElementpublic T findElementByCssSelector(String using) throws org.openqa.selenium.WebDriverException
findElementByCssSelector in interface TouchableElement<T extends WebElement>findElementByCssSelector in interface FindsByCssSelectorfindElementByCssSelector in class org.openqa.selenium.remote.RemoteWebElementorg.openqa.selenium.WebDriverException - his method doesn't work against native app UI.public T findElementByXPath(String using)
findElementByXPath in interface TouchableElement<T extends WebElement>findElementByXPath in interface FindsByXPathfindElementByXPath in class org.openqa.selenium.remote.RemoteWebElementpublic T findElementByAccessibilityId(String using)
findElementByAccessibilityId in interface FindsByAccessibilityId<T extends WebElement>public void submit()
throws org.openqa.selenium.WebDriverException
WebElementsubmit in interface WebElementsubmit in class org.openqa.selenium.remote.RemoteWebElementorg.openqa.selenium.WebDriverException - because it may not work against native app UI.public String getCssValue(String propertyName) throws org.openqa.selenium.WebDriverException
WebElementNote that shorthand CSS properties (e.g. background, font, border, border-top, margin, margin-top, padding, padding-top, list-style, outline, pause, cue) are not returned, in accordance with the DOM CSS2 specification - you should directly access the longhand properties (e.g. background-color) to access the desired values.
getCssValue in interface WebElementgetCssValue in class org.openqa.selenium.remote.RemoteWebElementpropertyName - the css property name of the elementorg.openqa.selenium.WebDriverException - because it may not work against native app UI.Copyright © 2016. All rights reserved.