Package io.karatelabs.driver
Interface Element
- All Superinterfaces:
io.karatelabs.js.ObjectLike,io.karatelabs.js.SimpleObject
- All Known Implementing Classes:
BaseElement,W3cElement
public interface Element
extends io.karatelabs.js.SimpleObject
Represents a DOM element found by a locator.
Provides element-scoped operations and fluent API for chaining.
Extends SimpleObject for JavaScript interoperability.
Implementations include:
BaseElement- Locator-based, delegates to Driver (works with any backend)
- See Also:
-
Field Summary
Fields inherited from interface io.karatelabs.js.SimpleObject
logger, TO_STRING -
Method Summary
Modifier and TypeMethodDescriptionclear()click()The closest ancestor (or self) matching the given CSS selector.booleanenabled()booleanexists()focus()html()booleanbooleanWhether this element matches the given CSS selector.position()position(boolean relative) retry()retry(int count) retry(int count, int interval) scroll()select(int index) submit()text()value()waitFor()waitForText(String expected) Methods inherited from interface io.karatelabs.js.ObjectLike
getMember, getPrototype, isExtensible, isFrozen, isOwnProperty, isSealed, putMember, removeMember, setExtensible, setFrozen, setSealedMethods inherited from interface io.karatelabs.js.SimpleObject
getMember, jsGet, jsKeys, jsToString, putMember, removeMember, toMap
-
Method Details
-
exists
boolean exists() -
isPresent
boolean isPresent() -
getLocator
String getLocator() -
text
String text() -
html
String html() -
innerHtml
String innerHtml() -
value
String value() -
attribute
-
property
-
enabled
boolean enabled() -
position
-
position
-
click
Element click() -
focus
Element focus() -
clear
Element clear() -
input
-
value
-
select
-
select
-
scroll
Element scroll() -
highlight
Element highlight() -
submit
Element submit() -
locate
-
locateAll
-
closest
The closest ancestor (or self) matching the given CSS selector. Mirrors the nativeElement.closest()DOM API — robust to markup shuffling, preferred over counting parent hops. -
matches
Whether this element matches the given CSS selector. Mirrors the nativeElement.matches()DOM API. -
script
-
waitFor
Element waitFor() -
waitForText
-
waitForEnabled
Element waitForEnabled() -
waitUntil
-
retry
Element retry() -
retry
-
retry
-