public interface IElement
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object obj)
Two
IElement s 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.
|
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.
|
void |
setAttribute(String name)
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 getAttribute(String name)
name
- The attribute nameString getName()
String getTextContent()
IElement getParent()
null
if none exists.null
List<IElement> getChildren()
IElement getElement(String xpath)
xpath
- The xpath to serachList<IElement> getElements(String xpath)
xpath
- The xpath to searchvoid setAttribute(String name)
string
- the attribute namevoid setAttribute(String name, String value)
string
- the attribute namevalue
- the new attribute valuevoid setTextContent(String value)
setAttribute("value")
instead.
This also sets the text content of a <textarea> element.value
- the new inner text content of this elementsetAttribute(String, String)
Copyright © 2002-2015 JWebUnit. All Rights Reserved.