(alert-text driver)
returns the text contained in a js alert box
returns the text contained in a js alert box
(attr webelement attribute)
(attr driver lookup-type lookup-string attribute)
returns the value of an element's attribute
returns the value of an element's attribute
(by lookup-type lookup-string)
Returns a By object. Used for element queries
Returns a By object. Used for element queries
(clear driver webelement)
(clear driver lookup-type lookup-string)
clears webelement
clears webelement
(click webelement)
(click driver webelement)
(click driver lookup-type & lookup-strings)
clicks an element
clicks an element
(cookie driver cookie-name)
(cookie driver cookie-name cookie-value)
Creates or retrieves a cookie named cookie-name. Sets cookie's value to cookie-value if provided
Creates or retrieves a cookie named cookie-name. Sets cookie's value to cookie-value if provided
(create-driver m)
(create-driver driver-type args)
creates a chrome or firefox driver based on passing in map m. Supported options: :driver-type, :driver-args, and :download-dir. Eg: (create-driver {:driver-type :chrome :driver-args ["--headless"] :download-dir "/tmp/folder"})
creates a chrome or firefox driver based on passing in map m. Supported options: :driver-type, :driver-args, and :download-dir. Eg: (create-driver {:driver-type :chrome :driver-args ["--headless"] :download-dir "/tmp/folder"})
(css webelement attribute)
(css driver lookup-type lookup-string attribute)
returns the value of a webelement's css value attribute
returns the value of a webelement's css value attribute
(enabled? elm)
(enabled? driver lookup-type lookup-string)
Returns true if element is enabled.
Returns true if element is enabled.
(execute-script driver js & js-args)
Executes js in webdriver
Executes js in webdriver
(get-element driver lookup-type lookup-string)
returns the first element matching lookup-type and lookup-string
returns the first element matching lookup-type and lookup-string
(get-element-value webelement attribute)
(get-element-value driver lookup-type lookup-string attribute)
gets the value of an element. :text for text and :value for value
gets the value of an element. :text for text and :value for value
(get-elements driver lookup-type lookup-string)
finds elements that match lookup-type and lookup-string and returns a vector of those WebElements
finds elements that match lookup-type and lookup-string and returns a vector of those WebElements
(get-visible-element driver lookup-type lookup-string)
returns the first visible elmeent matching lookip-type and lookup-string
returns the first visible elmeent matching lookip-type and lookup-string
(html options & content)
A wrapper around hiccup's html macro to avoid requiring yet another require
A wrapper around hiccup's html macro to avoid requiring yet another require
(iframe driver n)
(iframe driver lookup-type lookup-string)
switches to iframe by index or webelement (via calling (get-element lookup-type lookup-string))
switches to iframe by index or webelement (via calling (get-element lookup-type lookup-string))
(iframe-default driver)
switches to default content (main body of the html that contains all the iframes)
switches to default content (main body of the html that contains all the iframes)
(iframe-parent driver)
switches to parent iframe
switches to parent iframe
(implicit-wait driver timeout)
sets driver's implicit wait timeout (in seconds)
sets driver's implicit wait timeout (in seconds)
(input-text driver webelement s clear-element)
sets the value of a text input. If clear-element, element will be cleared before setting the text input
sets the value of a text input. If clear-element, element will be cleared before setting the text input
(insert-html driver elm html)
Appends given html to elm.. elm is the parent and html will be the child
Appends given html to elm.. elm is the parent and html will be the child
(is-visible element)
(is-visible driver lookup-type lookup-string)
Returns true if element is visible and enabled
Returns true if element is visible and enabled
(options elm)
(options driver lookup-type lookup-string)
returns a vector of the options available to elm. returns nil if elm is not a select element.
returns a vector of the options available to elm. returns nil if elm is not a select element.
(parent e)
(parent driver lookup-type lookup-string)
returns the parent of e
returns the parent of e
(post-sib e)
(post-sib driver lookup-type lookup-string)
returns a coll containing the following sibling elements of e
returns a coll containing the following sibling elements of e
(pre-sib e)
(pre-sib driver lookup-type lookup-string)
returns a coll containing the preceding sibling elements of e
returns a coll containing the preceding sibling elements of e
(q driver s)
Finds and returns webelement with name, id, tagName, className, linkText, text, or xpath. Note: not great to use if using implicit waits.
Finds and returns webelement with name, id, tagName, className, linkText, text, or xpath. Note: not great to use if using implicit waits.
(scroll-into-view driver webelement)
(scroll-into-view driver lookup-type lookup-string)
scrolls webelemnt into view
scrolls webelemnt into view
(selected? elm)
(selected? driver lookup-type lookup-string)
Returns true if element is selected
Returns true if element is selected
(send-keys element s)
sends element the keys found in str s
sends element the keys found in str s
(set-element driver e s)
(set-element driver lookup-type lookup-string s)
sets element e to value s. For select or input elements
sets element e to value s. For select or input elements
(set-elements driver e v)
(set-elements driver lookup-type lookup-strings values)
sets coll of elements e to coll of values v
sets coll of elements e to coll of values v
(set-elms driver coll)
(set-elms driver lookup-type coll)
partitions coll into lists of 2 each list becomes a key value pair where key is an element identifier and value is the value that element will be set to Eg: (set-elms driver :id [:input1 "hello" :input2 "world"]) if you pass in only a driver and coll, every odd element should be an WebElement
partitions coll into lists of 2 each list becomes a key value pair where key is an element identifier and value is the value that element will be set to Eg: (set-elms driver :id [:input1 "hello" :input2 "world"]) if you pass in only a driver and coll, every odd element should be an WebElement
(set-file-input element s)
Sets file input's path
Sets file input's path
(siblings e)
(siblings driver lookup-type lookup-string)
returns a map containing colls with the :preceding and :following sibling elements of e
returns a map containing colls with the :preceding and :following sibling elements of e
(to driver url)
Navigates driver to the given url
Navigates driver to the given url
(to-localhost driver)
Navigate driver to localhost, ignoring thrown exceptions
Navigate driver to localhost, ignoring thrown exceptions
(try-click driver lookup-type lookup-string)
(try-click driver lookup-type lookup-string timeout)
repeatedly trys to click webelement until no exception occurs or the timeout (seconds) expires
repeatedly trys to click webelement until no exception occurs or the timeout (seconds) expires
(visible? elm)
(visible? driver lookup-type lookup-string)
Returns true if element is visible
Returns true if element is visible
(wait-click driver lookup-type lookup-string)
(wait-click driver lookup-type lookup-string timeout)
waits with timeout (seconds) for element then clicks
waits with timeout (seconds) for element then clicks
(wait-elm-dom driver lookup-type lookup-string)
(wait-elm-dom driver lookup-type lookup-string max-wait)
Waits for element to exist in dom with a timeout of max-wait (seconds)
Waits for element to exist in dom with a timeout of max-wait (seconds)
(wait-for-download driver file-name timeout)
waits for download to finish up to timeout (seconds). returns file if download finishes before timeout, else nil.
waits for download to finish up to timeout (seconds). returns file if download finishes before timeout, else nil.
(wait-for-element driver lookup-type lookup-string)
(wait-for-element driver lookup-type lookup-string max-wait)
(wait-for-element driver lookup-type lookup-string max-wait poll-interval)
Explicitly waits for element to be clickable with a timeout of max-wait (seconds) and a poll-interval (milliseconds)
Explicitly waits for element to be clickable with a timeout of max-wait (seconds) and a poll-interval (milliseconds)
(wait-for-trans driver elm f)
(wait-for-trans driver elm timeout f)
(wait-for-trans driver elm timeout expected-transitions f)
waits for transitions of elm triggered by f to finish. timeout (milliseconds) should be longer than elm's transition duration expected-transitions is an int that should represent the number of transitions elm will go through when trigger f is executed
waits for transitions of elm triggered by f to finish. timeout (milliseconds) should be longer than elm's transition duration expected-transitions is an int that should represent the number of transitions elm will go through when trigger f is executed
(wait-q driver lookup-type lookup-string)
(wait-q driver lookup-type lookup-string timeout)
(wait-q driver lookup-type lookup-string timeout require-visible)
returns a list of elements. Does not return elements until the query contains visible elements require-visible determines if the final seq returned are only visible elements matching the query
returns a list of elements. Does not return elements until the query contains visible elements require-visible determines if the final seq returned are only visible elements matching the query
(with-all-drivers [driver driver-args] & body)
Same as with-driver but evaluates the forms in body agains all supported driver types. See examples in the unit tests
Same as with-driver but evaluates the forms in body agains all supported driver types. See examples in the unit tests
(with-driver driver-type driver-args & body)
creates a driver, executes the forms in body, and closes the driver. driver is closed in the case of an exception
creates a driver, executes the forms in body, and closes the driver. driver is closed in the case of an exception
(with-webdriver [driver &
{:keys [driver-type driver-args download-dir headless
xvfb-port]
:as params
:or {driver-args []
driver-type :chrome
download-dir nil
xvfb-port nil
headless false}}]
&
body)
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close