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(java.lang.String command)
Executes JSONWP command and returns a response.
|
org.openqa.selenium.remote.Response |
execute(java.lang.String driverCommand,
java.util.Map<java.lang.String,?> parameters)
Executes JSONWP command and returns a response.
|
T |
findElement(org.openqa.selenium.By by)
Find the first
WebElement using the given method. |
T |
findElement(java.lang.String by,
java.lang.String using)
Method performs the searching for a single element by some selector defined by string
and value of the given selector
|
T |
findElementByClassName(java.lang.String using) |
T |
findElementByCssSelector(java.lang.String using) |
T |
findElementById(java.lang.String id) |
T |
findElementByLinkText(java.lang.String using) |
T |
findElementByName(java.lang.String using) |
T |
findElementByPartialLinkText(java.lang.String using) |
T |
findElementByTagName(java.lang.String using) |
T |
findElementByXPath(java.lang.String using) |
java.util.List<MobileElement> |
findElements(org.openqa.selenium.By by)
Find all elements within the current context using the given mechanism.
|
java.util.List<MobileElement> |
findElements(java.lang.String by,
java.lang.String using)
Method performs the searching for a list of elements by some selector defined by string
and value of the given selector
|
java.util.List<MobileElement> |
findElementsByAccessibilityId(java.lang.String using) |
java.util.List<MobileElement> |
findElementsByClassName(java.lang.String using) |
java.util.List<MobileElement> |
findElementsByCssSelector(java.lang.String using) |
java.util.List<MobileElement> |
findElementsById(java.lang.String id) |
java.util.List<MobileElement> |
findElementsByLinkText(java.lang.String using) |
java.util.List<MobileElement> |
findElementsByName(java.lang.String using) |
java.util.List<MobileElement> |
findElementsByPartialLinkText(java.lang.String using) |
java.util.List<MobileElement> |
findElementsByTagName(java.lang.String using) |
java.util.List<MobileElement> |
findElementsByXPath(java.lang.String using) |
org.openqa.selenium.Point |
getCenter()
Method returns central coordinates of an element.
|
java.lang.String |
getCssValue(java.lang.String propertyName)
Get the value of a given CSS property.
|
void |
pinch()
Deprecated.
|
void |
setValue(java.lang.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)
Deprecated.
|
void |
swipe(SwipeElementDirection direction,
int offsetFromStartBorder,
int offsetFromEndBorder,
int duration)
Deprecated.
|
void |
tap(int fingers,
int duration)
Deprecated.
|
void |
zoom()
Deprecated.
|
clear, click, equals, 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
clear, click, getAttribute, getLocation, getRect, getSize, getTagName, getText, isDisplayed, isEnabled, isSelected, sendKeys
findElementByAccessibilityId
public org.openqa.selenium.Point getCenter()
Point
@Deprecated public void tap(int fingers, int duration)
fingers
- number of fingers/appendages to tap with.duration
- how long between pressing down, and lifting fingers/appendages.@Deprecated public void pinch()
@Deprecated public void zoom()
@Deprecated public void swipe(SwipeElementDirection direction, int duration)
@Deprecated public void swipe(SwipeElementDirection direction, int offsetFromStartBorder, int offsetFromEndBorder, int duration) throws IllegalCoordinatesException
IllegalCoordinatesException
public java.util.List<MobileElement> findElements(org.openqa.selenium.By by)
WebElement
findElements
in interface TouchableElement<MobileElement>
findElements
in interface SearchContext
findElements
in interface WebElement
by
- The locating mechanism to useWebElement
s, or an empty list if nothing matches.By
,
WebDriver.Timeouts
public java.util.List<MobileElement> findElements(java.lang.String by, java.lang.String using)
FindsByFluentSelector
findElements
in interface FindsByFluentSelector<MobileElement>
by
- is a string selectorusing
- is a value of the given selectorpublic java.util.List<MobileElement> findElementsById(java.lang.String id)
findElementsById
in interface TouchableElement<MobileElement>
findElementsById
in interface FindsById
public java.util.List<MobileElement> findElementsByLinkText(java.lang.String using)
findElementsByLinkText
in interface TouchableElement<MobileElement>
findElementsByLinkText
in interface FindsByLinkText
public java.util.List<MobileElement> findElementsByPartialLinkText(java.lang.String using)
findElementsByPartialLinkText
in interface TouchableElement<MobileElement>
findElementsByPartialLinkText
in interface FindsByLinkText
public java.util.List<MobileElement> findElementsByTagName(java.lang.String using)
findElementsByTagName
in interface TouchableElement<MobileElement>
findElementsByTagName
in interface FindsByTagName
public java.util.List<MobileElement> findElementsByName(java.lang.String using)
findElementsByName
in interface TouchableElement<MobileElement>
findElementsByName
in interface FindsByName
public java.util.List<MobileElement> findElementsByClassName(java.lang.String using)
findElementsByClassName
in interface TouchableElement<MobileElement>
findElementsByClassName
in interface FindsByClassName
public java.util.List<MobileElement> findElementsByCssSelector(java.lang.String using)
findElementsByCssSelector
in interface TouchableElement<MobileElement>
findElementsByCssSelector
in interface FindsByCssSelector
public java.util.List<MobileElement> findElementsByXPath(java.lang.String using)
findElementsByXPath
in interface TouchableElement<MobileElement>
findElementsByXPath
in interface FindsByXPath
public java.util.List<MobileElement> findElementsByAccessibilityId(java.lang.String using)
public void setValue(java.lang.String value)
value
- is the new value which should be setpublic org.openqa.selenium.remote.Response execute(java.lang.String driverCommand, java.util.Map<java.lang.String,?> parameters)
ExecutesMethod
execute
in interface ExecutesMethod
execute
in class org.openqa.selenium.remote.RemoteWebElement
driverCommand
- a JSONWP commandparameters
- map of command parameterspublic org.openqa.selenium.remote.Response execute(java.lang.String command)
ExecutesMethod
execute
in interface ExecutesMethod
command
- a JSONWP commandpublic T findElement(org.openqa.selenium.By by)
WebElement
WebElement
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 SearchContext
findElement
in interface WebElement
findElement
in class org.openqa.selenium.remote.RemoteWebElement
by
- The locating mechanismBy
,
WebDriver.Timeouts
public T findElement(java.lang.String by, java.lang.String using)
FindsByFluentSelector
findElement
in interface FindsByFluentSelector<T extends WebElement>
findElement
in class org.openqa.selenium.remote.RemoteWebElement
by
- is a string selectorusing
- is a value of the given selectorpublic T findElementById(java.lang.String id)
findElementById
in interface TouchableElement<T extends WebElement>
findElementById
in interface FindsById
findElementById
in class org.openqa.selenium.remote.RemoteWebElement
public T findElementByLinkText(java.lang.String using) throws org.openqa.selenium.WebDriverException
findElementByLinkText
in interface TouchableElement<T extends WebElement>
findElementByLinkText
in interface 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(java.lang.String using) throws org.openqa.selenium.WebDriverException
findElementByPartialLinkText
in interface TouchableElement<T extends WebElement>
findElementByPartialLinkText
in interface 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(java.lang.String using)
findElementByTagName
in interface TouchableElement<T extends WebElement>
findElementByTagName
in interface FindsByTagName
findElementByTagName
in class org.openqa.selenium.remote.RemoteWebElement
public T findElementByName(java.lang.String using)
findElementByName
in interface TouchableElement<T extends WebElement>
findElementByName
in interface FindsByName
findElementByName
in class org.openqa.selenium.remote.RemoteWebElement
public T findElementByClassName(java.lang.String using)
findElementByClassName
in interface TouchableElement<T extends WebElement>
findElementByClassName
in interface FindsByClassName
findElementByClassName
in class org.openqa.selenium.remote.RemoteWebElement
public T findElementByCssSelector(java.lang.String using) throws org.openqa.selenium.WebDriverException
findElementByCssSelector
in interface TouchableElement<T extends WebElement>
findElementByCssSelector
in interface 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(java.lang.String using)
findElementByXPath
in interface TouchableElement<T extends WebElement>
findElementByXPath
in interface FindsByXPath
findElementByXPath
in class org.openqa.selenium.remote.RemoteWebElement
public void submit() throws org.openqa.selenium.WebDriverException
WebElement
submit
in interface WebElement
submit
in class org.openqa.selenium.remote.RemoteWebElement
org.openqa.selenium.WebDriverException
- because it may not work against native app UI.public java.lang.String getCssValue(java.lang.String propertyName) throws org.openqa.selenium.WebDriverException
WebElement
Note 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 WebElement
getCssValue
in class org.openqa.selenium.remote.RemoteWebElement
propertyName
- the css property name of the elementorg.openqa.selenium.WebDriverException
- because it may not work against native app UI.