public class AndroidWebElement extends java.lang.Object implements WebElement, SearchContext, WrapsDriver, Locatable
Modifier and Type | Method and Description |
---|---|
void |
clear()
If this element is a text entry element, this will clear the value.
|
void |
click()
Click this element.
|
void |
dragAndDropBy(int moveRightBy,
int moveDownBy) |
void |
dragAndDropOn(AndroidWebElement element) |
boolean |
equals(java.lang.Object o) |
WebElement |
findElement(By by)
Find the first
WebElement using the given method. |
java.util.List<WebElement> |
findElements(By by)
Find all elements within the current context using the given mechanism.
|
java.lang.String |
getAttribute(java.lang.String name)
Get the value of a the given attribute of the element.
|
Coordinates |
getCoordinates() |
java.lang.String |
getCssValue(java.lang.String propertyName)
Get the value of a given CSS property.
|
Point |
getLocation()
Where on the page is the top left-hand corner of the rendered element? it's part of
RenderedWebElement
|
Point |
getLocationOnScreenOnceScrolledIntoView()
Deprecated.
To be removed in 2.31. Use
getCoordinates() instead |
Dimension |
getSize()
What is the width and height of the rendered element?
|
java.lang.String |
getTagName()
Get the tag name of this element.
|
java.lang.String |
getText()
Get the visible (i.e.
|
java.lang.String |
getValueOfCssProperty(java.lang.String property) |
WebDriver |
getWrappedDriver() |
int |
hashCode() |
void |
hover() |
boolean |
isDisplayed()
Is this element displayed or not? This method avoids the problem of having to parse an
element's "style" attribute.
|
boolean |
isEnabled()
Is the element currently enabled or not? This will generally return true for everything but
disabled input elements.
|
boolean |
isSelected()
Determine whether or not this element is selected or not.
|
void |
sendKeys(java.lang.CharSequence... value)
Use this method to simulate typing into an element, which may set its 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.
|
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public void click()
WebElement
click
in interface WebElement
public void submit()
WebElement
submit
in interface WebElement
public void clear()
WebElement
WebElement.sendKeys(CharSequence...)
with the backspace key. To ensure
you get a change event, consider following with a call to WebElement.sendKeys(CharSequence...)
with the tab key.clear
in interface WebElement
public void sendKeys(java.lang.CharSequence... value)
WebElement
sendKeys
in interface WebElement
public java.lang.String getTagName()
WebElement
"input"
for the element <input name="foo" />
.getTagName
in interface WebElement
public java.lang.String getAttribute(java.lang.String name)
WebElement
getAttribute
in interface WebElement
name
- The name of the attribute.public boolean isSelected()
WebElement
isSelected
in interface WebElement
public boolean isEnabled()
WebElement
isEnabled
in interface WebElement
public java.lang.String getText()
WebElement
getText
in interface WebElement
public WebElement findElement(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 SearchContext
findElement
in interface WebElement
by
- The locating mechanismBy
,
WebDriver.Timeouts
public java.util.List<WebElement> findElements(By by)
WebElement
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 void dragAndDropBy(int moveRightBy, int moveDownBy)
public void dragAndDropOn(AndroidWebElement element)
public Point getLocation()
getLocation
in interface WebElement
public Dimension getSize()
WebElement
getSize
in interface WebElement
Point
where x is the width, and y is the height.public java.lang.String getValueOfCssProperty(java.lang.String property)
public void hover()
public boolean isDisplayed()
WebElement
isDisplayed
in interface WebElement
public WebDriver getWrappedDriver()
getWrappedDriver
in interface WrapsDriver
public java.lang.String getCssValue(java.lang.String propertyName)
WebElement
getCssValue
in interface WebElement
public Coordinates getCoordinates()
getCoordinates
in interface Locatable
@Deprecated public Point getLocationOnScreenOnceScrolledIntoView()
getCoordinates()
insteadLocatable
getLocationOnScreenOnceScrolledIntoView
in interface Locatable