      (api/element-enabled *server* *session* *element*))))
 
 (defn visible? []
+  ;; todo C. Element Displayedness
   )
 
 ;;

     (with-server host# port#
       (with-process host# port#
         ~@body))))

(defn random-port []
  (let [max-port 65536
        offset 1024]
    (+ (rand-int (- max-port offset))
       offset)))

(deftest simple-test
  (let [host "127.0.0.1"

(defmacro with-xpath [& body]
  `(with-locator "xpath"
     ~@body))

;;
;; windowing
;;

(defmacro with-window [handler & body]
  `(let [h# (api/get-window-handle *server* *session*)]
     (api/switch-to-window *server* *session* ~handler)
     (try
       ~@body
       (finally
         (api/switch-to-window *server* *session* h#)))))

(defmacro with-all-windows [& body]
  `(doseq [h# (api/get-window-handles *server* *session*)]
     (with-window h#
       ~@body)))

(defn close []
  (api/close-window *server* *session*))

;;
;; navigation
