Liking cljdoc? Tell your friends :D

sparkledriver.element


attrclj

(attr element attribute)

Return the value of attribute for element

Return the value of `attribute` for `element`
sourceraw docstring

clear-text!clj

(clear-text! element)

Clear the current text of text-entry element. Used with send-text! to manipulate form fields.

Clear the current text of text-entry `element`. Used with send-text! to manipulate form fields.
sourceraw docstring

click!clj

(click! element)

Send a browser click event to element.

Send a browser click event to `element`.
sourceraw docstring

click-all!clj

(click-all! elements)

Click every element in the sequence elements. Returns the number of elements clicked.

Click every element in the sequence `elements`. Returns the number of elements clicked.
sourceraw docstring

css-valueclj

(css-value element property)

Return the value of CSS property for element

Return the value of CSS `property` for `element`
sourceraw docstring

displayed?clj

(displayed? element)

Is this element displayed or not? This method avoids the problem of having to parse an element's CSS.

Is this element displayed or not? This method avoids the problem of having to parse an element's CSS.
sourceraw docstring

enabled?clj

(enabled? element)

Is the element currently enabled or not? This will generally return true for everything but disabled input elements.

Is the element currently enabled or not? This will generally return true for everything but disabled input elements.
sourceraw docstring

find-by-classclj

(find-by-class browser-or-elem class)

Return the first element with class name class that's a child of browser-or-elem (which can be a browser or element). Throws an exception if there's no such element! If called with retry-fn bound - for example by using the with-retry macro - will wrap the operation in that function.

Return the first element with class name `class` that's a child of `browser-or-elem` (which can be a browser or element). Throws an exception if there's no such element! If called with *retry-fn* bound - for example by using the `with-retry` macro - will wrap the operation in that function.
sourceraw docstring

find-by-class*clj

(find-by-class* browser-or-elem class)

Return all elements with class name class that are children of browser-or-elem (which can be a browser or element) or an empty sequence. If called with retry-fn bound - for example by using the with-retry macro - will wrap the operation in that function.

Return all elements with class name `class` that are children of `browser-or-elem` (which can be a browser or element) or an empty sequence. If called with *retry-fn* bound - for example by using the `with-retry` macro - will wrap the operation in that function.
sourceraw docstring

find-by-cssclj

(find-by-css browser-or-elem css-selector)

Return the first element that matches css-selector, starting from browser-or-elem (which can be a browser or element). Throws an exception if there's no such element! If called with retry-fn bound - for example by using the with-retry macro - will wrap the operation in that function.

Return the first element that matches `css-selector`, starting from `browser-or-elem` (which can be a browser or element). Throws an exception if there's no such element! If called with *retry-fn* bound - for example by using the `with-retry` macro - will wrap the operation in that function.
sourceraw docstring

find-by-css*clj

(find-by-css* browser-or-elem css-selector)

Return all elements that match css-selector, starting from browser-or-elem (which can be a browser or element) or an empty sequence. If called with retry-fn bound - for example by using the with-retry macro - will wrap the operation in that function.

Return all elements that match `css-selector`, starting from `browser-or-elem` (which can be a browser or element) or an empty sequence. If called with *retry-fn* bound - for example by using the `with-retry` macro - will wrap the operation in that function.
sourceraw docstring

find-by-idclj

(find-by-id browser-or-elem id)

Return the single element with id that's a child of browser-or-elem (which can be a browser or element). Throws an exception if there's no such element! If called with retry-fn bound - for example by using the with-retry macro - will wrap the operation in that function.

Return the single element with `id` that's a child of `browser-or-elem` (which can be a browser or element). Throws an exception if there's no such element! If called with *retry-fn* bound - for example by using the `with-retry` macro - will wrap the operation in that function.
sourceraw docstring

find-by-tagclj

(find-by-tag browser-or-elem tag)

Return the first element with tag name tag that's a child of browser-or-elem (which can be a browser or element). Throws an exception if there's no such element! If called with retry-fn bound - for example by using the with-retry macro - will wrap the operation in that function.

Return the first element with tag name `tag` that's a child of `browser-or-elem` (which can be a browser or element). Throws an exception if there's no such element! If called with *retry-fn* bound - for example by using the `with-retry` macro - will wrap the operation in that function.
sourceraw docstring

find-by-tag*clj

(find-by-tag* browser-or-elem tag)

Return all elements with tag name tag that are children of browser-or-elem (which can be a browser or element) or an empty sequence. If called with retry-fn bound - for example by using the with-retry macro - will wrap the operation in that function.

Return all elements with tag name `tag` that are children of `browser-or-elem` (which can be a browser or element) or an empty sequence. If called with *retry-fn* bound - for example by using the `with-retry` macro - will wrap the operation in that function.
sourceraw docstring

find-by-xpathclj

(find-by-xpath browser-or-elem xpath)

Return the first element that matches xpath, starting from browser-or-elem (which can be a browser or element). Throws an exception if there's no such element! If called with retry-fn bound - for example by using the with-retry macro - will wrap the operation in that function.

For example:

(with-browser [browser (make-browser)]
  (-> (fetch! browser "http://clojure.org")
      (find-by-xpath* "//div[@class='clj-intro-message']/p")
      (nth 2)
      text))
;;=> "I hope you find Clojure's combination of facilities elegant, powerful, practical and fun to use."
Return the first element that matches `xpath`, starting from `browser-or-elem` (which can be a browser or element). Throws an exception if there's no such element! If called with *retry-fn* bound - for example by using the `with-retry` macro - will wrap the operation in that function.

  For example:

```
(with-browser [browser (make-browser)]
  (-> (fetch! browser "http://clojure.org")
      (find-by-xpath* "//div[@class='clj-intro-message']/p")
      (nth 2)
      text))
;;=> "I hope you find Clojure's combination of facilities elegant, powerful, practical and fun to use."
```
sourceraw docstring

find-by-xpath*clj

(find-by-xpath* browser-or-elem xpath)

Return all elements that match xpath, starting from browser-or-elem (which can be a browser or element) or an empty sequence. If called with retry-fn bound - for example by using the with-retry macro - will wrap the operation in that function.

Return all elements that match `xpath`, starting from `browser-or-elem` (which can be a browser or element) or an empty sequence. If called with *retry-fn* bound - for example by using the `with-retry` macro - will wrap the operation in that function.
sourceraw docstring

idclj

(id element)

Return the value of the id attribute of element

Return the value of the id attribute of `element`
sourceraw docstring

inner-htmlclj

(inner-html element)

Return the innerHTML of element

Return the innerHTML of `element`
sourceraw docstring

locationclj

(location element)

Location on the page of the top left-hand corner of the rendered element.

Location on the page of the top left-hand corner of the rendered element.
sourceraw docstring

outer-htmlclj

(outer-html element)

Return the outerHTML of element

Return the outerHTML of `element`
sourceraw docstring

rectangleclj

(rectangle element)

The location and size of the rendered element.

The location and size of the rendered element.
sourceraw docstring

screenshotclj

(screenshot browser)

Takes a screenshot of browser's current state and stores the image in a temporary file, then returns the file's absolute path.

(N.B. this function is in the element namespace because it should take a browser or an element, but there's presently an upstream bug preventing this from working.)

Takes a screenshot of `browser`'s current state and stores the image in a temporary file, then returns the file's absolute path.

(N.B. this function is in the element namespace because it should take a browser or an element, but there's presently an [upstream bug](https://github.com/jackrusher/sparkledriver/issues/12) preventing this from working.)
sourceraw docstring

selected?clj

(selected? element)

Return whether or not this element is selected

Return whether or not this element is selected 
sourceraw docstring

send-text!clj

(send-text! element text)

Send the string text to element, as if the user typed it.

Send the string `text` to `element`, as if the user typed it.
sourceraw docstring

sizeclj

(size element)

What is the width and height of the rendered element?

What is the width and height of the rendered element?
sourceraw docstring

submit-form!clj

(submit-form! element)

Submit element, which should be an HTML form.

Submit `element`, which should be an HTML form.
sourceraw docstring

tagclj

(tag element)

Return the tag name of element

Return the tag name of `element`
sourceraw docstring

textclj

(text element)

Return the complete visible textual content of element (including any children). Text from hidden elements is not included.

Return the complete visible textual content of `element` (including any children). Text from hidden elements is not included.
sourceraw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close