clj-chrome-devtools.automation
Higher level automation convenience API
*wait-ms*
dynamic
automation?
(automation? a)
bounding-box
(bounding-box node)
(bounding-box {c :connection, :as ctx} node)
clear-text-input
(clear-text-input node)
(clear-text-input {c :connection, :as ctx} node)
Clear a text input value.
click
(click node)
(click {c :connection, :as ctx} node)
create-automation
(create-automation connection)
(create-automation connection on-close)
current-automation
default-timeout-ms
dispose!
(dispose!)
Dispose the current automation and set it to nil.
double-click
(double-click node)
(double-click {c :connection, :as ctx} node)
evaluate
(evaluate expression)
(evaluate ctx expression)
(evaluate {c :connection, :as _ctx} expression timeout-ms)
file-download
(file-download url-pattern interaction-fn)
(file-download {c :connection, :as ctx} url-pattern interaction-fn)
Run the given interaction-fn which will interact with the page and cause a file download. Monitors network activity to receive a file where the request matches the given URL pattern. Returns a map describing the downloaded file and also has the content.
focus
(focus node)
(focus {c :connection, :as ctx} node)
Focus an input element
html-of
(html-of node)
(html-of {c :connection, :as ctx} node)
input-text
(input-text node text)
(input-text {c :connection, :as ctx} node text)
Type text to an input field.
print-pdf
(print-pdf)
(print-pdf automation)
(print-pdf automation filename)
(print-pdf {c :connection} filename options)
Print current page to PDF.
root
(root)
(root {c :connection})
Returns the root node for id reference.
screenshot
(screenshot)
(screenshot automation)
(screenshot {c :connection} filename)
scroll-into-view
(scroll-into-view node)
(scroll-into-view {c :connection, :as ctx} node)
Make the given node visible by scrolling to it if necessary. Returns the center X/Y of the element.
sel
(sel selector)
(sel {c :connection, :as ctx} selector)
Select elements by selector.
sel1
(sel1 selector)
(sel1 {c :connection, :as ctx} selector)
Select a single element by selector.
set-attribute
(set-attribute node attribute-name attribute-value)
(set-attribute {c :connection, :as ctx} node attribute-name attribute-value)
start!
(start!)
Start a new CDP connection and an automation context for it. Sets the current automation context.
text-of
(text-of node)
(text-of {c :connection, :as ctx} node)
to
(to url)
(to {c :connection, r :root} url)
Navigate to the given URL. Waits for browser load to be finished before returning.
visible
(visible node)
(visible {c :connection, :as ctx} node)
Wait for element to become visible, return true if element is visible, false otherwise.
wait
macro
(wait wait-category result-not body)
(wait wait-category result-not on-failure body)
wait-request
(wait-request url-pattern interaction-fn)
Run the given interaction-fn that causes the page to fetch some resource. Monitor network activity to and wait for a request that matches the URL pattern. Returns response information.
WebAddress
protocol
A web address that can be converted into a string.
members
as-string
(as-string this)
with-timeout
macro
(with-timeout ms body)
If the timeout elapses before the body has completed, an ExceptionInfo will be thrown.