WebElement class

WebDriver representation and interactions with an HTML element.

Implemented types


WebElement(WebDriver driver, SyncRequestClient _client, WebDriverHandler _handler, String id, [SearchContext? context, dynamic locator, int? index])


asyncContext SearchContext
Produces a compatible async_core.SearchContext. Allows backwards compatibility with other frameworks.
no setteroverride
asyncElement WebElement
Produces a compatible async_core.WebElement. Allows backwards compatibility with other frameworks.
no setter
attributes Attributes
Access to the HTML attributes of this tag.
no setter
context SearchContext?
The context from which this element was found.
cssProperties Attributes
Access to the cssProperties of this element.
no setter
displayed bool
Is this element visible in the page?
no setter
driver WebDriver
enabled bool
Is this form element enabled?
no setter
hashCode int
The hash code for this object.
no setteroverride
id String
index int?
The index of this element in the set of element founds. If the method used to find this element always returns one element, then this is null.
location Point<int>
The location of the element.
no setter
locator → dynamic
How the element was located from the context.
name String
The tag name for this element.
no setter
parent WebElement?
no setter
parents List<String>
Gets a chain of parent elements, including the element itself.
no setter
properties Attributes
Access to the HTML properties of this tag.
no setter
rect Rectangle<int>
The bounds of this element.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
selected bool
Is this radio button/checkbox selected?
no setter
size Rectangle<int>
The size of this element.
no setter
text String
Visible text within this element.
no setter


clear() → void
Clear the content of a text element.
click() → void
Click on this element.
equals(WebElement other) bool
Are these two elements the same underlying element in the DOM.
findElement(By by) WebElement
Find an element nested within this element.
findElements(By by) List<WebElement>
Find multiple elements nested within this element.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
sendKeys(String keysToSend) → void
Send keysToSend to this element.
toJson() Map<String, String>
toString() String
A string representation of this object.
toStringDeep() String


operator ==(Object other) bool
The equality operator.