Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: 421cdcbdc8
Fetching contributors…

Cannot retrieve contributors at this time

26 lines (23 sloc) 0.779 kb
(ns ^{:doc "Utilties atop third-party dependendies."}
webdriver-logic.util
(:use [clojure.core.logic :only [lvar?]])
(:require [clj-webdriver.core :as wd])
(:import [org.openqa.selenium InvalidElementStateException]
[org.openqa.selenium.remote ErrorHandler$UnknownServerException]))
(defn fresh?
"Returns true, if `x' is fresh.
`x' must have been `walk'ed before!"
[x]
(lvar? x))
(defn ground?
"Returns true, if `x' is ground.
`x' must have been `walk'ed before!"
[x]
(not (lvar? x)))
(defmacro careful-attribute
"Wrap calls to wd/attribute in try and catch standard exceptions"
[elem attr]
`(try
(wd/attribute ~elem ~attr)
(catch InvalidElementStateException _# nil)
(catch ErrorHandler$UnknownServerException _# nil)))
Jump to Line
Something went wrong with that request. Please try again.