|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface WebElement
Represents an HTML element. Generally, all interesting operations to do with interacting with a page will be performed through this interface.
| Method Summary | |
|---|---|
void |
clear()
If this element is a text entry element, this will clear the value. |
void |
click()
Click this element. |
WebElement |
findElement(By by)
Find the first WebElement using the given method. |
java.util.List<WebElement> |
findElements(By by)
Find all elements within the current context using the given mechanism. |
java.lang.String |
getAttribute(java.lang.String name)
Get the value of a the given attribute of the element. |
java.lang.String |
getTagName()
Get the tag name of this element. |
java.lang.String |
getText()
Get the innerText of this element, without any leading or trailing whitespace. |
java.lang.String |
getValue()
Get the value of the element's "value" attribute. |
boolean |
isEnabled()
Is the element currently enabled or not? |
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 |
setSelected()
Select an element. |
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()
If the element is a checkbox this will toggle the elements state from selected to not selected, or from not selected to selected. |
| Method Detail |
|---|
void click()
void submit()
NoSuchElementException - If the given element is not within a formjava.lang.String getValue()
getAttribute(String)void sendKeys(java.lang.CharSequence... keysToSend)
void clear()
java.lang.String getTagName()
"input" for the element <input name="foo" />.
java.lang.String getAttribute(java.lang.String name)
name - The name of the attribute.
boolean toggle()
boolean isSelected()
void setSelected()
boolean isEnabled()
java.lang.String getText()
java.util.List<WebElement> findElements(By by)
findElements in interface SearchContextby - The locating mechanism to use
WebElements, or an empty list if nothing matchesByWebElement findElement(By by)
WebElement using the given method.
findElement in interface SearchContextby - The locating mechanism
NoSuchElementException - If no matching elements are found
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||