(all-windows browser)
Return a set of handles for all browser
windows.
Return a set of handles for all `browser` windows.
(attachments-dir browser)
Return the path to the directory where the browser is storing attachment files.
Return the path to the directory where the browser is storing attachment files.
(available-log-types browser)
Return a set of strings representing the types of logs available for browser
. N.B. browser
must have been initialized with some kind of logging enabled, for isntance :log-trace or :log-wire.
Return a set of strings representing the types of logs available for `browser`. N.B. `browser` must have been initialized with some kind of logging enabled, for isntance :log-trace or :log-wire.
The possible options for building a browser instance in {:option [default setter-fn]} format.
The possible options for building a browser instance in {:option [default setter-fn]} format.
(cache-dir browser)
Return the path to the directory where the browser is storing cached files.
Return the path to the directory where the browser is storing cached files.
(close-browser! browser)
Close a browser instance, killing the underlying subprocess and freeing all resources.
Close a browser instance, killing the underlying subprocess and freeing all resources.
(current-url browser)
Return the currently visited url of browser
.
Return the currently visited url of `browser`.
(current-window browser)
Return a handle for the currently active browser
window.
Return a handle for the currently active `browser` window.
(execute-script browser script & arguments)
Executes JavaScript script
in the context of the currently selected frame or window of browser
with arguments
.
Executes JavaScript `script` in the context of the currently selected frame or window of `browser` with `arguments`.
(execute-script-async browser script & arguments)
Asynchronously execute JavaScript script
in the context of the currently selected frame or window of browser
with arguments
.
Asynchronously execute JavaScript `script` in the context of the currently selected frame or window of `browser` with `arguments`.
(fetch! browser url)
Fetch 'url' using 'browser' and return browser after loading is complete.
(fetch! browser "http://www.clojure.com/")
;;=> returns browser after navigating to the clojure site
Fetch 'url' using 'browser' and return browser after loading is complete. ```clojure (fetch! browser "http://www.clojure.com/") ;;=> returns browser after navigating to the clojure site ```
(logs browser & kind)
Return browser
's logs of whatever kind
, or all if not specified. See http://machinepublishers.github.io/jBrowserDriver/org/openqa/selenium/logging/LogEntry.html for details of the returned items. Example:
(map #(.getMessage %) (logs browser))
;;=> events that have occurred since the last time you did this
Return `browser`'s logs of whatever `kind`, or all if not specified. See http://machinepublishers.github.io/jBrowserDriver/org/openqa/selenium/logging/LogEntry.html for details of the returned items. Example: ``` (map #(.getMessage %) (logs browser)) ;;=> events that have occurred since the last time you did this ```
(make-browser & options)
Creates a new headless browser instance parameterized by options
. Examples:
(make-browser :log-wire true) ; log network traffic
(make-browser :ajax-wait 1000) ; wait 1000ms for JS to run after page load
(make-browser :headless false) ; pop up a browser window to watch it work
Creates a new headless browser instance parameterized by `options`. Examples: ```clojure (make-browser :log-wire true) ; log network traffic (make-browser :ajax-wait 1000) ; wait 1000ms for JS to run after page load (make-browser :headless false) ; pop up a browser window to watch it work ```
(maximize-window browser)
Maximize browser
's currently focused window.
Maximize `browser`'s currently focused window.
(media-dir browser)
Return the path to the directory where the browser is storing media files.
Return the path to the directory where the browser is storing media files.
(page-source browser)
Return the HTML source of the currently visited page in browser
.
Return the HTML source of the currently visited page in `browser`.
(page-text browser)
Return the complete visible textual content of the current page in the focused window of browser
. Text from hidden elements is not included.
Return the complete visible textual content of the current page in the focused window of `browser`. Text from hidden elements is not included.
(page-wait browser)
Blocks until the browser's current page quiesces. N.B. This is the default for many operations, so this function is likely only useful when things are misbehaving.
Blocks until the browser's current page quiesces. N.B. This is the default for many operations, so this function is likely only useful when things are misbehaving.
(status-code browser)
Return the current HTTP status code of browser
.
Return the current HTTP status code of `browser`.
(switch-to-alert browser)
Switch browser
's focus to the current alert popup. Returns the alert's handle.
Switch `browser`'s focus to the current alert popup. Returns the alert's handle.
(switch-to-window browser window)
Switch browser
to window
, which should be a handle returned by all-windows or current-window.
Switch `browser` to `window`, which should be a handle returned by all-windows or current-window.
(title browser)
Return the title of the current page in the focused window of browser
.
Return the title of the current page in the focused window of `browser`.
(with-browser binding & body)
Evaluate body
in a try block within which binding
is bound, finally calling close-browser on binding. This is just a version of with-open that traps the exception that closing a jBrowserDriver instance currently throws.
Evaluate `body` in a try block within which `binding` is bound, finally calling close-browser on binding. This is just a version of with-open that traps the exception that closing a jBrowserDriver instance currently throws.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close