Public Vars

Back

execute (clj)

(source)

function

(execute {:keys [driver method path data]})
Return response from having `:driver` execute HTTP `:method` request to `:path` with body `:data`. Response body automatically converted from JSON to a clojure keywordized map. Any HTTP status failure code results in a throw. - `:method` HTTP method, e.g. `:get`, `:post`, `:delete`, etc. - `:path` a vector of strings/keywords representing a server's path. For example: - this: `[:session "aaaa-bbbb-cccc" :element "dddd-eeee" :find]` - becomes: `"/session/aaaa-bbbb-cccc/element/dddd-eeee/find"`. - `:data` optional body to send. Automatically converted to JSON. This can be useful to call when you want to invoke some WebDriver implementation specific feature that Etaoin has not otherwise exposed. For example, if Etaoin did not already have [[get-url]]: ```Clojure (def driver (e/firefox)) (e/go driver "https://clojure.org") (e/execute {:driver driver :method :get :path [:session (:session driver) :url]}) ;; => {:value "https://clojure.org/"} ```

Examples