Constructor and Description |
---|
WebDriverElementImpl(org.openqa.selenium.WebDriver driver,
org.openqa.selenium.WebElement element) |
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.
|
org.openqa.selenium.WebElement |
getHtmlElement()
Return the unwrapped Webdriver 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 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 |
toString() |
public WebDriverElementImpl(org.openqa.selenium.WebDriver driver, org.openqa.selenium.WebElement element)
public String getAttribute(String name)
IElement
getAttribute
in interface IElement
name
- The attribute namepublic String getName()
IElement
public List<IElement> getChildren()
IElement
getChildren
in interface IElement
public IElement getParent()
IElement
null
if none exists.public String getTextContent()
IElement
getTextContent
in interface IElement
public IElement getElement(String xpath)
IElement
getElement
in interface IElement
xpath
- The xpath to serachpublic List<IElement> getElements(String xpath)
IElement
getElements
in interface IElement
xpath
- The xpath to searchpublic void setAttribute(String name)
IElement
setAttribute
in interface IElement
public void setAttribute(String name, String value)
IElement
setAttribute
in interface IElement
value
- the new attribute valuepublic void setTextContent(String value)
IElement
setAttribute("value")
instead.
This also sets the text content of a <textarea> element.setTextContent
in interface IElement
value
- the new inner text content of this elementIElement.setAttribute(String, String)
public boolean equals(Object obj)
IElement
IElement
s are equal if they
refer to the same element in the current page.public org.openqa.selenium.WebElement getHtmlElement()
Copyright © 2002-2015 JWebUnit. All Rights Reserved.