public interface WebElementGetter extends TimeoutRelated<WebElementGetter>
The methods of this interface are returning properties of a single WebElement instance.
Each getter method blocks the current thread until the element is accessible.
This waiting has a timeout which can be specified with the TimeoutRelated.withTimeout(Enum) or TimeoutRelated.withTimeout(String)
method. If no timeout is specified then the default timeout will be used.
| Modifier and Type | Method and Description |
|---|---|
String |
attribute(String name)
Returns the named attribute of the element.
|
String[] |
cssClassNames()
Returns the CSS class names of the element.
|
String |
cssValue(String propertyName)
Returns the CSS property value of the element.
|
String |
fileName()
Returns the file name of the element.
|
String |
id()
Returns the \"id\" attribute of the element.
|
String[] |
selectedOptions()
Returns the text content of all the selected options of the element.
|
String |
tagName()
Returns the tag name of the element.
|
String |
text()
Returns the text of the element.
|
String |
value()
Returns the value of the element.
|
withTimeout, withTimeoutString id()
This methods blocks the thread until the element is accessible or the time runs out.
If the element does not have "id" attribute, this method returns an empty string (and never null).
String value()
This methods blocks the thread until the element is accessible or the time runs out.
If the element does not have value, this method returns an empty string (and never null).
String fileName()
This methods blocks the thread until the element is accessible or the time runs out.
If the element does not have file name, this method returns an empty string (and never null).
String attribute(String name)
This methods blocks the thread until the element is accessible or the time runs out.
If the element does not have the attribute, this method returns an empty string (and never null).
name - the name of the desired attribute or an empty stringString tagName()
This methods blocks the thread until the element is accessible or the time runs out.
String[] cssClassNames()
This methods blocks the thread until the element is accessible or the time runs out.
If the element does not have class names, this method returns an empty array (and never null).
String cssValue(String propertyName)
This methods blocks the thread until the element is accessible or the time runs out.
If the element does not have that property, this method returns an empty string (and never null).
propertyName - the name of the desired CSS propertyString text()
This methods blocks the thread until the element is accessible or the time runs out.
If the element does not have text, this method returns an empty string (and never null).
String[] selectedOptions()
This methods blocks the thread until the element is accessible or the time runs out.
If the element does not have selected options, this method returns an empty array (and never null).
Created by Kornél Simon, 2022