Locator and ElementHandle operations.
Locators are the primary way to find and interact with elements. They auto-wait and auto-retry, making them the preferred API.
Locator and ElementHandle operations. Locators are the primary way to find and interact with elements. They auto-wait and auto-retry, making them the preferred API.
(all loc)Returns all elements matching the locator as individual locators.
Params:
loc - Locator instance.
Returns: Vector of Locator instances.
Returns all elements matching the locator as individual locators. Params: `loc` - Locator instance. Returns: Vector of Locator instances.
(all-inner-texts loc)Returns all inner texts for matching elements.
Params:
loc - Locator instance.
Returns: Vector of strings.
Returns all inner texts for matching elements. Params: `loc` - Locator instance. Returns: Vector of strings.
(all-text-contents loc)Returns all text contents for matching elements.
Params:
loc - Locator instance.
Returns: Vector of strings.
Returns all text contents for matching elements. Params: `loc` - Locator instance. Returns: Vector of strings.
(blur loc)Blurs (removes focus from) the element.
Params:
loc - Locator instance.
Returns: nil or anomaly map on failure.
Blurs (removes focus from) the element. Params: `loc` - Locator instance. Returns: nil or anomaly map on failure.
(bounding-box loc)Returns the bounding box of the element.
Params:
loc - Locator instance.
Returns: Map with :x :y :width :height or nil.
Returns the bounding box of the element. Params: `loc` - Locator instance. Returns: Map with :x :y :width :height or nil.
(check loc)(check loc check-opts)Checks a checkbox or radio button.
Params:
loc - Locator instance.
opts - Map, optional. Check options.
Returns: nil or anomaly map on failure.
Checks a checkbox or radio button. Params: `loc` - Locator instance. `opts` - Map, optional. Check options. Returns: nil or anomaly map on failure.
(clear loc)Clears input field content.
Params:
loc - Locator instance.
Returns: nil or anomaly map on failure.
Clears input field content. Params: `loc` - Locator instance. Returns: nil or anomaly map on failure.
(click loc)(click loc click-opts)Clicks an element.
Params:
loc - Locator instance.
opts - Map, optional. Click options.
Returns: nil or anomaly map on failure.
Clicks an element. Params: `loc` - Locator instance. `opts` - Map, optional. Click options. Returns: nil or anomaly map on failure.
(content-frame loc)Returns a FrameLocator pointing to the same iframe as this locator. Use when the locator points to an iframe element and you need to interact with elements inside the frame.
Params:
loc - Locator instance pointing to an iframe element.
Returns: FrameLocator instance.
Returns a FrameLocator pointing to the same iframe as this locator. Use when the locator points to an iframe element and you need to interact with elements inside the frame. Params: `loc` - Locator instance pointing to an iframe element. Returns: FrameLocator instance.
(count-elements loc)Returns the number of elements matching the locator.
Params:
loc - Locator instance.
Returns: Long.
Returns the number of elements matching the locator. Params: `loc` - Locator instance. Returns: Long.
(dblclick loc)(dblclick loc dblclick-opts)Double-clicks an element.
Params:
loc - Locator instance.
opts - Map, optional. Double-click options.
Returns: nil or anomaly map on failure.
Double-clicks an element. Params: `loc` - Locator instance. `opts` - Map, optional. Double-click options. Returns: nil or anomaly map on failure.
(dispatch-event loc type)Dispatches a DOM event on the element.
Params:
loc - Locator instance.
type - String. Event type (e.g. "click").
Returns: nil or anomaly map.
Dispatches a DOM event on the element. Params: `loc` - Locator instance. `type` - String. Event type (e.g. "click"). Returns: nil or anomaly map.
(drag-to loc target)Drags this locator to another locator.
Params:
loc - Locator instance (source).
target - Locator instance (target).
Returns: nil or anomaly map.
Drags this locator to another locator. Params: `loc` - Locator instance (source). `target` - Locator instance (target). Returns: nil or anomaly map.
(eh-bounding-box eh)Returns the bounding box of the element handle.
Returns the bounding box of the element handle.
(eh-click eh)(eh-click eh click-opts)Clicks an element handle.
Params:
eh - ElementHandle instance.
opts - Map, optional. Click options.
Clicks an element handle. Params: `eh` - ElementHandle instance. `opts` - Map, optional. Click options.
(eh-dispose! eh)Disposes the element handle.
Params:
eh - ElementHandle instance.
Disposes the element handle. Params: `eh` - ElementHandle instance.
(eh-fill eh value)Fills text into an element handle.
Params:
eh - ElementHandle instance.
value - String.
Fills text into an element handle. Params: `eh` - ElementHandle instance. `value` - String.
(eh-get-attribute eh name)Returns an attribute value of the element handle.
Params:
eh - ElementHandle instance.
name - String. Attribute name.
Returns: String or nil.
Returns an attribute value of the element handle. Params: `eh` - ElementHandle instance. `name` - String. Attribute name. Returns: String or nil.
(eh-inner-html eh)Returns inner HTML of an element handle.
Params:
eh - ElementHandle instance.
Returns: String.
Returns inner HTML of an element handle. Params: `eh` - ElementHandle instance. Returns: String.
(eh-inner-text eh)Returns inner text of an element handle.
Params:
eh - ElementHandle instance.
Returns: String.
Returns inner text of an element handle. Params: `eh` - ElementHandle instance. Returns: String.
(eh-is-checked? eh)Returns whether the element handle is checked.
Returns whether the element handle is checked.
(eh-is-enabled? eh)Returns whether the element handle is enabled.
Returns whether the element handle is enabled.
(eh-is-visible? eh)Returns whether the element handle is visible.
Returns whether the element handle is visible.
(eh-screenshot eh)(eh-screenshot eh screenshot-opts)Takes a screenshot of the element.
Takes a screenshot of the element.
(eh-text-content eh)Returns text content of an element handle.
Params:
eh - ElementHandle instance.
Returns: String or nil.
Returns text content of an element handle. Params: `eh` - ElementHandle instance. Returns: String or nil.
(element-handle loc)Returns the ElementHandle for the first matching element.
Params:
loc - Locator instance.
Returns: ElementHandle or anomaly map.
Returns the ElementHandle for the first matching element. Params: `loc` - Locator instance. Returns: ElementHandle or anomaly map.
(element-handles loc)Returns all ElementHandles matching the locator.
Params:
loc - Locator instance.
Returns: Vector of ElementHandle.
Returns all ElementHandles matching the locator. Params: `loc` - Locator instance. Returns: Vector of ElementHandle.
(evaluate-all loc expression)(evaluate-all loc expression arg)Evaluates JavaScript on all elements matching the locator.
Params:
loc - Locator instance.
expression - String. JavaScript expression.
Returns: Result or anomaly map.
Evaluates JavaScript on all elements matching the locator. Params: `loc` - Locator instance. `expression` - String. JavaScript expression. Returns: Result or anomaly map.
(evaluate-locator loc expression)(evaluate-locator loc expression arg)Evaluates JavaScript on the element found by this locator.
Params:
loc - Locator instance.
expression - String. JavaScript expression.
arg - Optional argument.
Returns: Result or anomaly map.
Evaluates JavaScript on the element found by this locator. Params: `loc` - Locator instance. `expression` - String. JavaScript expression. `arg` - Optional argument. Returns: Result or anomaly map.
(fill loc value)(fill loc value fill-opts)Fills an input element with text.
Params:
loc - Locator instance.
value - String. Text to fill.
opts - Map, optional. Fill options.
Returns: nil or anomaly map on failure.
Fills an input element with text. Params: `loc` - Locator instance. `value` - String. Text to fill. `opts` - Map, optional. Fill options. Returns: nil or anomaly map on failure.
(first-element loc)Returns the first element matching the locator.
Params:
loc - Locator instance.
Returns: Locator for the first element.
Returns the first element matching the locator. Params: `loc` - Locator instance. Returns: Locator for the first element.
(focus loc)Focuses the element.
Params:
loc - Locator instance.
Returns: nil or anomaly map on failure.
Focuses the element. Params: `loc` - Locator instance. Returns: nil or anomaly map on failure.
(get-attribute loc name)Returns the value of an attribute.
Params:
loc - Locator instance.
name - String. Attribute name.
Returns: String or nil, or anomaly map.
Returns the value of an attribute. Params: `loc` - Locator instance. `name` - String. Attribute name. Returns: String or nil, or anomaly map.
(highlight loc)Highlights the element for debugging.
Params:
loc - Locator instance.
Highlights the element for debugging. Params: `loc` - Locator instance.
(hover loc)(hover loc hover-opts)Hovers over an element.
Params:
loc - Locator instance.
opts - Map, optional. Hover options.
Returns: nil or anomaly map on failure.
Hovers over an element. Params: `loc` - Locator instance. `opts` - Map, optional. Hover options. Returns: nil or anomaly map on failure.
(inner-html loc)Returns the inner HTML of the element.
Params:
loc - Locator instance.
Returns: String, or anomaly map.
Returns the inner HTML of the element. Params: `loc` - Locator instance. Returns: String, or anomaly map.
(inner-text loc)Returns the inner text of the element.
Params:
loc - Locator instance.
Returns: String, or anomaly map.
Returns the inner text of the element. Params: `loc` - Locator instance. Returns: String, or anomaly map.
(input-value loc)Returns the input value of an input element.
Params:
loc - Locator instance.
Returns: String, or anomaly map.
Returns the input value of an input element. Params: `loc` - Locator instance. Returns: String, or anomaly map.
(is-checked? loc)Returns whether the element is checked.
Params:
loc - Locator instance.
Returns: Boolean.
Returns whether the element is checked. Params: `loc` - Locator instance. Returns: Boolean.
(is-disabled? loc)Returns whether the element is disabled.
Params:
loc - Locator instance.
Returns: Boolean.
Returns whether the element is disabled. Params: `loc` - Locator instance. Returns: Boolean.
(is-editable? loc)Returns whether the element is editable.
Params:
loc - Locator instance.
Returns: Boolean.
Returns whether the element is editable. Params: `loc` - Locator instance. Returns: Boolean.
(is-enabled? loc)Returns whether the element is enabled.
Params:
loc - Locator instance.
Returns: Boolean.
Returns whether the element is enabled. Params: `loc` - Locator instance. Returns: Boolean.
(is-hidden? loc)Returns whether the element is hidden.
Params:
loc - Locator instance.
Returns: Boolean.
Returns whether the element is hidden. Params: `loc` - Locator instance. Returns: Boolean.
(is-visible? loc)Returns whether the element is visible.
Params:
loc - Locator instance.
Returns: Boolean.
Returns whether the element is visible. Params: `loc` - Locator instance. Returns: Boolean.
(js-as-element handle)Casts a JSHandle to ElementHandle if possible.
Params:
handle - JSHandle instance.
Returns: ElementHandle or nil.
Casts a JSHandle to ElementHandle if possible. Params: `handle` - JSHandle instance. Returns: ElementHandle or nil.
(js-dispose! handle)Disposes the JSHandle.
Params:
handle - JSHandle instance.
Disposes the JSHandle. Params: `handle` - JSHandle instance.
(js-evaluate handle expression)(js-evaluate handle expression arg)Evaluates JavaScript on a JSHandle.
Params:
handle - JSHandle instance.
expression - String. JavaScript expression.
Returns: Result or anomaly map.
Evaluates JavaScript on a JSHandle. Params: `handle` - JSHandle instance. `expression` - String. JavaScript expression. Returns: Result or anomaly map.
(js-get-properties handle)Gets all properties of a JSHandle.
Params:
handle - JSHandle instance.
Returns: Map of property name to JSHandle.
Gets all properties of a JSHandle. Params: `handle` - JSHandle instance. Returns: Map of property name to JSHandle.
(js-get-property handle name)Gets a property of a JSHandle.
Params:
handle - JSHandle instance.
name - String. Property name.
Returns: JSHandle for the property.
Gets a property of a JSHandle. Params: `handle` - JSHandle instance. `name` - String. Property name. Returns: JSHandle for the property.
(js-json-value handle)Returns the JSON value of a JSHandle.
Params:
handle - JSHandle instance.
Returns: Parsed JSON value.
Returns the JSON value of a JSHandle. Params: `handle` - JSHandle instance. Returns: Parsed JSON value.
(last-element loc)Returns the last element matching the locator.
Params:
loc - Locator instance.
Returns: Locator for the last element.
Returns the last element matching the locator. Params: `loc` - Locator instance. Returns: Locator for the last element.
(loc-filter loc opts)Filters this locator to a narrower set.
Params:
loc - Locator instance.
opts - Map with optional:
:has-text - String or Pattern.
:has - Locator.
:has-not - Locator.
:has-not-text - String or Pattern.
Returns: Locator instance.
Filters this locator to a narrower set. Params: `loc` - Locator instance. `opts` - Map with optional: :has-text - String or Pattern. :has - Locator. :has-not - Locator. :has-not-text - String or Pattern. Returns: Locator instance.
(loc-get-by-label loc text)Locates elements by label within this locator.
Params:
loc - Locator instance.
text - String or Pattern.
Returns: Locator instance.
Locates elements by label within this locator. Params: `loc` - Locator instance. `text` - String or Pattern. Returns: Locator instance.
(loc-get-by-role loc role)Locates elements by ARIA role within this locator.
Params:
loc - Locator instance.
role - AriaRole enum value.
Returns: Locator instance.
Locates elements by ARIA role within this locator. Params: `loc` - Locator instance. `role` - AriaRole enum value. Returns: Locator instance.
(loc-get-by-test-id loc test-id)Locates elements by test ID within this locator.
Params:
loc - Locator instance.
test-id - String or Pattern.
Returns: Locator instance.
Locates elements by test ID within this locator. Params: `loc` - Locator instance. `test-id` - String or Pattern. Returns: Locator instance.
(loc-get-by-text loc text)Locates elements by text within this locator.
Params:
loc - Locator instance.
text - String or Pattern.
Returns: Locator instance.
Locates elements by text within this locator. Params: `loc` - Locator instance. `text` - String or Pattern. Returns: Locator instance.
(loc-locator loc selector)Creates a sub-locator within this locator.
Params:
loc - Locator instance.
selector - String. CSS or text selector.
Returns: Locator instance.
Creates a sub-locator within this locator. Params: `loc` - Locator instance. `selector` - String. CSS or text selector. Returns: Locator instance.
(locator-screenshot loc)(locator-screenshot loc ss-opts)Takes a screenshot of the element.
Params:
loc - Locator instance.
opts - Map, optional. Screenshot options.
Returns: byte[] or anomaly map.
Takes a screenshot of the element. Params: `loc` - Locator instance. `opts` - Map, optional. Screenshot options. Returns: byte[] or anomaly map.
(nth-element loc index)Returns the nth element matching the locator.
Params:
loc - Locator instance.
index - Long. Zero-based index.
Returns: Locator for the nth element.
Returns the nth element matching the locator. Params: `loc` - Locator instance. `index` - Long. Zero-based index. Returns: Locator for the nth element.
(press loc key)(press loc key press-opts)Presses a key or key combination.
Params:
loc - Locator instance.
key - String. Key to press (e.g. "Enter", "Control+a").
opts - Map, optional. Press options.
Returns: nil or anomaly map on failure.
Presses a key or key combination. Params: `loc` - Locator instance. `key` - String. Key to press (e.g. "Enter", "Control+a"). `opts` - Map, optional. Press options. Returns: nil or anomaly map on failure.
(scroll-into-view loc)Scrolls element into view.
Params:
loc - Locator instance.
Returns: nil or anomaly map.
Scrolls element into view. Params: `loc` - Locator instance. Returns: nil or anomaly map.
(select-option loc values)Selects options in a select element.
Params:
loc - Locator instance.
values - String, vector of strings, or SelectOption.
Returns: Vector of selected values or anomaly map.
Selects options in a select element. Params: `loc` - Locator instance. `values` - String, vector of strings, or SelectOption. Returns: Vector of selected values or anomaly map.
(set-input-files! loc files)Sets the value of a file input element.
Params:
loc - Locator instance.
files - String path or vector of string paths.
Returns: nil or anomaly map.
Sets the value of a file input element. Params: `loc` - Locator instance. `files` - String path or vector of string paths. Returns: nil or anomaly map.
(tap-element loc)Taps an element (for touch devices).
Params:
loc - Locator instance.
Returns: nil or anomaly map on failure.
Taps an element (for touch devices). Params: `loc` - Locator instance. Returns: nil or anomaly map on failure.
(text-content loc)Returns the text content of the element.
Params:
loc - Locator instance.
Returns: String or nil, or anomaly map.
Returns the text content of the element. Params: `loc` - Locator instance. Returns: String or nil, or anomaly map.
(type-text loc text)(type-text loc text type-opts)Types text into an element character by character.
Params:
loc - Locator instance.
text - String. Text to type.
opts - Map, optional. Type options.
Returns: nil or anomaly map on failure.
Types text into an element character by character. Params: `loc` - Locator instance. `text` - String. Text to type. `opts` - Map, optional. Type options. Returns: nil or anomaly map on failure.
(uncheck loc)(uncheck loc uncheck-opts)Unchecks a checkbox.
Params:
loc - Locator instance.
opts - Map, optional. Uncheck options.
Returns: nil or anomaly map on failure.
Unchecks a checkbox. Params: `loc` - Locator instance. `opts` - Map, optional. Uncheck options. Returns: nil or anomaly map on failure.
(wait-for loc)(wait-for loc wait-opts)Waits for the locator to satisfy a condition.
Params:
loc - Locator instance.
opts - Map, optional. Wait options (:state, :timeout).
Returns: nil or anomaly map on timeout.
Waits for the locator to satisfy a condition. Params: `loc` - Locator instance. `opts` - Map, optional. Wait options (:state, :timeout). Returns: nil or anomaly map on timeout.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |