Package io.karatelabs.driver
Class Finder
java.lang.Object
io.karatelabs.driver.Finder
Positional element finder for relative locators.
Allows finding elements based on their position relative to a reference element.
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionClick the first matching element.booleanCheck if the element exists.Find the first element matching the locator that satisfies the positional constraint.Find all elements matching the locator that satisfy the positional constraint.within(double pixels) Set the tolerance for "near" matching.
-
Constructor Details
-
Finder
-
-
Method Details
-
within
Set the tolerance for "near" matching.- Parameters:
pixels- the tolerance in pixels- Returns:
- a new Finder with the specified tolerance
-
find
Find the first element matching the locator that satisfies the positional constraint.- Parameters:
locator- the locator for candidate elements- Returns:
- the first matching element
- Throws:
DriverException- if no matching element is found
-
findAll
Find all elements matching the locator that satisfy the positional constraint.- Parameters:
locator- the locator for candidate elements- Returns:
- list of matching elements, sorted by distance to reference
-
click
Click the first matching element. -
exists
Check if the element exists.
-