Package io.karatelabs.driver
Class BaseElement
java.lang.Object
io.karatelabs.driver.BaseElement
- All Implemented Interfaces:
Element,io.karatelabs.js.ObjectLike,io.karatelabs.js.SimpleObject
- Direct Known Subclasses:
W3cElement
Locator-based Element implementation that delegates all operations to a Driver.
This is the default implementation used by all backends (CDP, W3C WebDriver, etc.).
Operations are performed by passing the locator to the Driver, which handles
backend-specific execution (JS eval for CDP, HTTP calls for W3C, etc.).
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final Driverprotected final booleanprotected final StringFields inherited from interface io.karatelabs.js.SimpleObject
logger, TO_STRING -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidclear()click()booleanenabled()booleanexists()focus()html()booleanstatic BaseElementstatic BaseElementposition()position(boolean relative) retry()retry(int count) retry(int count, int interval) scroll()select(int index) submit()text()toString()value()waitFor()waitForText(String expected) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface io.karatelabs.js.ObjectLike
getPrototypeMethods inherited from interface io.karatelabs.js.SimpleObject
getMember, jsKeys, jsToString, putMember, removeMember, toMap
-
Field Details
-
driver
-
locator
-
exists
protected final boolean exists
-
-
Constructor Details
-
BaseElement
-
-
Method Details
-
of
-
optional
-
exists
public boolean exists() -
isPresent
public boolean isPresent() -
getLocator
- Specified by:
getLocatorin interfaceElement
-
text
-
html
-
innerHtml
-
value
-
attribute
-
property
-
enabled
public boolean enabled() -
position
-
position
-
click
-
focus
-
clear
-
input
-
value
-
select
-
select
-
scroll
-
highlight
-
submit
-
locate
-
locateAll
-
script
-
waitFor
-
waitForText
- Specified by:
waitForTextin interfaceElement
-
waitForEnabled
- Specified by:
waitForEnabledin interfaceElement
-
waitUntil
-
retry
-
retry
-
retry
-
jsGet
- Specified by:
jsGetin interfaceio.karatelabs.js.SimpleObject
-
assertExists
protected void assertExists() -
toString
-