| Constructor and Description |
|---|
HtmlUnitElementImpl(DomElement element) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object obj)
Two
IElements are equal if they
refer to the same element in the current page. |
String |
getAttribute(String name)
Get the value of an attribute.
|
List<IElement> |
getChildren()
Get direct child elements of this element.
|
IElement |
getElement(String xpath)
Get an element from this element by xpath.
|
List<IElement> |
getElements(String xpath)
Get all elements from this element by xpath.
|
DomElement |
getHtmlElement()
Return the unwrapped HtmlUnit element that this IElement represents.
|
String |
getName()
Get the element name, for example "input", "textarea", "select".
|
IElement |
getParent()
Get the parent element, or
null if none exists. |
String |
getTextContent()
Get the text content, if any, of this element.
|
int |
hashCode() |
void |
setAttribute(String string)
Set an attribute on this element, e.g.
|
void |
setAttribute(String name,
String value)
Set an attribute on this element.
|
void |
setTextContent(String value)
Set the text content on this element.
|
String |
toString() |
public HtmlUnitElementImpl(DomElement element)
public String getAttribute(String name)
IElementgetAttribute in interface IElementname - The attribute namepublic String getName()
IElementpublic List<IElement> getChildren()
IElementgetChildren in interface IElementpublic IElement getParent()
IElementnull if none exists.public String getTextContent()
IElementgetTextContent in interface IElementpublic IElement getElement(String xpath)
IElementgetElement in interface IElementxpath - The xpath to serachpublic List<IElement> getElements(String xpath)
IElementgetElements in interface IElementxpath - The xpath to searchpublic void setAttribute(String string)
IElementsetAttribute in interface IElementpublic void setAttribute(String name, String value)
IElementsetAttribute in interface IElementvalue - the new attribute valuepublic void setTextContent(String value)
IElementsetAttribute("value") instead.
This also sets the text content of a <textarea> element.setTextContent in interface IElementvalue - the new inner text content of this elementIElement.setAttribute(String, String)public boolean equals(Object obj)
IElementIElements are equal if they
refer to the same element in the current page.public DomElement getHtmlElement()
Copyright © 2002-2015 JWebUnit. All Rights Reserved.