public class RemoteWebElement extends java.lang.Object implements WebElement, FindsByLinkText, FindsById, FindsByName, FindsByTagName, FindsByClassName, FindsByCssSelector, FindsByXPath, WrapsDriver, Locatable
| Modifier and Type | Field and Description |
|---|---|
protected FileDetector |
fileDetector |
protected java.lang.String |
id |
protected org.openqa.selenium.remote.RemoteMouse |
mouse |
protected RemoteWebDriver |
parent |
| Constructor and Description |
|---|
RemoteWebElement() |
| 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.
|
boolean |
equals(java.lang.Object obj) |
protected Response |
execute(java.lang.String command,
java.util.Map<java.lang.String,?> parameters) |
WebElement |
findElement(By by)
Find the first
WebElement using the given method. |
protected WebElement |
findElement(java.lang.String using,
java.lang.String value) |
WebElement |
findElementByClassName(java.lang.String using) |
WebElement |
findElementByCssSelector(java.lang.String using) |
WebElement |
findElementById(java.lang.String using) |
WebElement |
findElementByLinkText(java.lang.String using) |
WebElement |
findElementByName(java.lang.String using) |
WebElement |
findElementByPartialLinkText(java.lang.String using) |
WebElement |
findElementByTagName(java.lang.String using) |
WebElement |
findElementByXPath(java.lang.String using) |
java.util.List<WebElement> |
findElements(By by)
Find all elements within the current context using the given mechanism.
|
protected java.util.List<WebElement> |
findElements(java.lang.String using,
java.lang.String value) |
java.util.List<WebElement> |
findElementsByClassName(java.lang.String using) |
java.util.List<WebElement> |
findElementsByCssSelector(java.lang.String using) |
java.util.List<WebElement> |
findElementsById(java.lang.String using) |
java.util.List<WebElement> |
findElementsByLinkText(java.lang.String using) |
java.util.List<WebElement> |
findElementsByName(java.lang.String using) |
java.util.List<WebElement> |
findElementsByPartialLinkText(java.lang.String using) |
java.util.List<WebElement> |
findElementsByTagName(java.lang.String using) |
java.util.List<WebElement> |
findElementsByXPath(java.lang.String using) |
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.
|
java.lang.String |
getId() |
Point |
getLocation()
Where on the page is the top left-hand corner of the rendered element?
|
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.
|
WebDriver |
getWrappedDriver() |
int |
hashCode() |
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... keysToSend)
Use this method to simulate typing into an element, which may set its value.
|
void |
setFileDetector(FileDetector detector) |
protected void |
setFoundBy(SearchContext foundFrom,
java.lang.String locator,
java.lang.String term) |
void |
setId(java.lang.String id) |
void |
setParent(RemoteWebDriver parent) |
void |
submit()
If this current element is a form, or an element within a form, then this will be submitted to
the remote server.
|
java.lang.String |
toString() |
protected java.lang.String id
protected RemoteWebDriver parent
protected org.openqa.selenium.remote.RemoteMouse mouse
protected FileDetector fileDetector
protected void setFoundBy(SearchContext foundFrom, java.lang.String locator, java.lang.String term)
public void setParent(RemoteWebDriver parent)
public java.lang.String getId()
public void setId(java.lang.String id)
public void setFileDetector(FileDetector detector)
public void click()
WebElementclick in interface WebElementpublic void submit()
WebElementsubmit in interface WebElementpublic void sendKeys(java.lang.CharSequence... keysToSend)
WebElementsendKeys in interface WebElementpublic void clear()
WebElementWebElement.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 WebElementpublic java.lang.String getTagName()
WebElement"input" for the element <input name="foo" />.getTagName in interface WebElementpublic java.lang.String getAttribute(java.lang.String name)
WebElementgetAttribute in interface WebElementname - The name of the attribute.public boolean isSelected()
WebElementisSelected in interface WebElementpublic boolean isEnabled()
WebElementisEnabled in interface WebElementpublic java.lang.String getText()
WebElementgetText in interface WebElementpublic java.lang.String getCssValue(java.lang.String propertyName)
WebElementgetCssValue in interface WebElementpublic java.util.List<WebElement> findElements(By by)
WebElementfindElements in interface SearchContextfindElements in interface WebElementby - The locating mechanism to useWebElements, or an empty list if nothing matches.By,
WebDriver.Timeoutspublic WebElement findElement(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 SearchContextfindElement in interface WebElementby - The locating mechanismBy,
WebDriver.Timeoutsprotected WebElement findElement(java.lang.String using, java.lang.String value)
protected java.util.List<WebElement> findElements(java.lang.String using, java.lang.String value)
public WebElement findElementById(java.lang.String using)
findElementById in interface FindsByIdpublic java.util.List<WebElement> findElementsById(java.lang.String using)
findElementsById in interface FindsByIdpublic WebElement findElementByLinkText(java.lang.String using)
findElementByLinkText in interface FindsByLinkTextpublic java.util.List<WebElement> findElementsByLinkText(java.lang.String using)
findElementsByLinkText in interface FindsByLinkTextpublic WebElement findElementByName(java.lang.String using)
findElementByName in interface FindsByNamepublic java.util.List<WebElement> findElementsByName(java.lang.String using)
findElementsByName in interface FindsByNamepublic WebElement findElementByClassName(java.lang.String using)
findElementByClassName in interface FindsByClassNamepublic java.util.List<WebElement> findElementsByClassName(java.lang.String using)
findElementsByClassName in interface FindsByClassNamepublic WebElement findElementByCssSelector(java.lang.String using)
findElementByCssSelector in interface FindsByCssSelectorpublic java.util.List<WebElement> findElementsByCssSelector(java.lang.String using)
findElementsByCssSelector in interface FindsByCssSelectorpublic WebElement findElementByXPath(java.lang.String using)
findElementByXPath in interface FindsByXPathpublic java.util.List<WebElement> findElementsByXPath(java.lang.String using)
findElementsByXPath in interface FindsByXPathpublic WebElement findElementByPartialLinkText(java.lang.String using)
findElementByPartialLinkText in interface FindsByLinkTextpublic java.util.List<WebElement> findElementsByPartialLinkText(java.lang.String using)
findElementsByPartialLinkText in interface FindsByLinkTextpublic WebElement findElementByTagName(java.lang.String using)
findElementByTagName in interface FindsByTagNamepublic java.util.List<WebElement> findElementsByTagName(java.lang.String using)
findElementsByTagName in interface FindsByTagNameprotected Response execute(java.lang.String command, java.util.Map<java.lang.String,?> parameters)
public boolean equals(java.lang.Object obj)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic WebDriver getWrappedDriver()
getWrappedDriver in interface WrapsDriverpublic boolean isDisplayed()
WebElementisDisplayed in interface WebElementpublic Point getLocation()
WebElementgetLocation in interface WebElementpublic Dimension getSize()
WebElementgetSize in interface WebElementpublic Coordinates getCoordinates()
getCoordinates in interface Locatablepublic java.lang.String toString()
toString in class java.lang.Object