   "https://www.w3.org/TR/webdriver/#dfn-get-element-rect"
   (-> server
       (client/call :get
-                   [:session (session-id session) :element element :rect])))
+                   [:session session :element element :rect])))
 
 (defn is-element-enabled [server session element]
   "https://www.w3.org/TR/webdriver/#dfn-is-element-enabled"
   (-> server
       (client/call :get
-                   [:session (session-id session) :element element :enabled])
+                   [:session session :element element :enabled])
       :value))
 
 (defn element-click [server session element]
   "https://www.w3.org/TR/webdriver/#dfn-is-element-enabled"
   (-> server
       (client/call :post
-                   [:session (session-id session) :element element :click])
+                   [:session session :element element :click])
       :value))
 
 (defn ^{:chrome false}

  (let [meth :post
        path [:session session :url]
        body {:url url}
        resp (client/call meth path body)]
    (-> resp :value)))

(defn get-current-url

  "https://www.w3.org/TR/webdriver/#dfn-accept-alert"
  (-> server
      (client/call :post
                   [:session session :alert :accept])))

(defn get-alert-text [server session]
  "https://www.w3.org/TR/webdriver/#dfn-get-alert-text"
  (-> server
      (client/call :get
                   [:session session :alert :text])
      :value))

(defn send-alert-text [server session text]
  "https://www.w3.org/TR/webdriver/#dfn-send-alert-text"
  (-> server
      (client/call :post
                   [:session session :alert :text]
                   {:value (text-to-array text)})))

(defn take-screenshot [server session filename]
  "https://www.w3.org/TR/webdriver/#dfn-take-screenshot"
  (-> server
      (client/call :get
                   [:session session :screenshot])
      :value
      (check-screenshot {:server server
                         :filename filename})
