|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.openqa.selenium.htmlunit.HtmlUnitWebElement
public class HtmlUnitWebElement
Field Summary | |
---|---|
protected com.gargoylesoftware.htmlunit.html.HtmlElement |
element
|
protected HtmlUnitDriver |
parent
|
Constructor Summary | |
---|---|
HtmlUnitWebElement(HtmlUnitDriver parent,
com.gargoylesoftware.htmlunit.html.HtmlElement element)
|
Method Summary | |
---|---|
protected void |
assertElementNotStale()
|
void |
clear()
If this element is a text entry element, this will clear the value. |
void |
click()
Click this element. |
boolean |
equals(Object obj)
|
WebElement |
findElement(By by)
Find the first WebElement using the given method. |
WebElement |
findElementByCssSelector(String using)
|
WebElement |
findElementById(String id)
|
WebElement |
findElementByLinkText(String linkText)
|
WebElement |
findElementByPartialLinkText(String linkText)
|
WebElement |
findElementByTagName(String name)
|
WebElement |
findElementByXPath(String xpathExpr)
|
List<WebElement> |
findElements(By by)
Find all elements within the current context using the given mechanism. |
List<WebElement> |
findElementsByCssSelector(String using)
|
List<WebElement> |
findElementsById(String id)
|
List<WebElement> |
findElementsByLinkText(String linkText)
|
List<WebElement> |
findElementsByPartialLinkText(String linkText)
|
List<WebElement> |
findElementsByTagName(String name)
|
List<WebElement> |
findElementsByXPath(String xpathExpr)
|
String |
getAttribute(String name)
Get the value of a the given attribute of the element. |
Coordinates |
getCoordinates()
|
String |
getCssValue(String propertyName)
Get the value of a given CSS property. |
protected com.gargoylesoftware.htmlunit.html.HtmlElement |
getElement()
|
List<WebElement> |
getElementsByTagName(String tagName)
|
Point |
getLocation()
Where on the page is the top left-hand corner of the rendered element? |
Point |
getLocationOnScreenOnceScrolledIntoView()
Use this to discover where on the screen an element is so that we can click it. |
protected HtmlUnitDriver |
getParent()
|
Dimension |
getSize()
What is the width and height of the rendered element? |
String |
getTagName()
Get the tag name of this element. |
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 |
sendKeyDownEvent(Keys modifierKey)
|
void |
sendKeys(CharSequence... value)
Use this method to simulate typing into an element, which may set its value. |
void |
sendKeyUpEvent(Keys modifierKey)
|
void |
setSelected()
|
void |
submit()
If this current element is a form, or an element within a form, then this will be submitted to the remote server. |
boolean |
toggle()
|
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected final HtmlUnitDriver parent
protected final com.gargoylesoftware.htmlunit.html.HtmlElement element
Constructor Detail |
---|
public HtmlUnitWebElement(HtmlUnitDriver parent, com.gargoylesoftware.htmlunit.html.HtmlElement element)
Method Detail |
---|
public void click()
WebElement
click
in interface WebElement
public void submit()
WebElement
submit
in interface WebElement
public void clear()
WebElement
clear
in interface WebElement
public void sendKeyDownEvent(Keys modifierKey)
public void sendKeyUpEvent(Keys modifierKey)
public void sendKeys(CharSequence... value)
WebElement
sendKeys
in interface WebElement
public String getTagName()
WebElement
"input"
for the element <input name="foo" />
.
getTagName
in interface WebElement
public String getAttribute(String name)
WebElement
getAttribute
in interface WebElement
name
- The name of the attribute.
public boolean toggle()
public boolean isSelected()
WebElement
isSelected
in interface WebElement
public void setSelected()
public boolean isEnabled()
WebElement
isEnabled
in interface WebElement
public boolean isDisplayed()
WebElement
isDisplayed
in interface WebElement
public Point getLocation()
WebElement
getLocation
in interface WebElement
public Dimension getSize()
WebElement
getSize
in interface WebElement
public String getText()
WebElement
getText
in interface WebElement
protected HtmlUnitDriver getParent()
protected com.gargoylesoftware.htmlunit.html.HtmlElement getElement()
public List<WebElement> getElementsByTagName(String tagName)
public WebElement findElement(By by)
WebElement
WebElement
using the given method. See the note in
WebElement.findElement(By)
about finding via XPath.
findElement
in interface SearchContext
findElement
in interface WebElement
by
- The locating mechanism
public List<WebElement> findElements(By by)
WebElement
findElements
in interface SearchContext
findElements
in interface WebElement
by
- The locating mechanism to use
WebElement
s, or an empty list if nothing matches.By
public WebElement findElementById(String id)
findElementById
in interface FindsById
public List<WebElement> findElementsById(String id)
findElementsById
in interface FindsById
public List<WebElement> findElementsByCssSelector(String using)
findElementsByCssSelector
in interface FindsByCssSelector
public WebElement findElementByCssSelector(String using)
findElementByCssSelector
in interface FindsByCssSelector
public WebElement findElementByXPath(String xpathExpr)
findElementByXPath
in interface FindsByXPath
public List<WebElement> findElementsByXPath(String xpathExpr)
findElementsByXPath
in interface FindsByXPath
public WebElement findElementByLinkText(String linkText)
findElementByLinkText
in interface FindsByLinkText
public List<WebElement> findElementsByLinkText(String linkText)
findElementsByLinkText
in interface FindsByLinkText
public WebElement findElementByPartialLinkText(String linkText)
findElementByPartialLinkText
in interface FindsByLinkText
public List<WebElement> findElementsByPartialLinkText(String linkText)
findElementsByPartialLinkText
in interface FindsByLinkText
public WebElement findElementByTagName(String name)
findElementByTagName
in interface FindsByTagName
public List<WebElement> findElementsByTagName(String name)
findElementsByTagName
in interface FindsByTagName
public String toString()
toString
in class Object
protected void assertElementNotStale()
public String getCssValue(String propertyName)
WebElement
getCssValue
in interface WebElement
public boolean equals(Object obj)
equals
in class Object
public int hashCode()
hashCode
in class Object
public WebDriver getWrappedDriver()
getWrappedDriver
in interface WrapsDriver
public Point getLocationOnScreenOnceScrolledIntoView()
Locatable
getLocationOnScreenOnceScrolledIntoView
in interface Locatable
public Coordinates getCoordinates()
getCoordinates
in interface Locatable
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |