Permalink
Browse files

Provide convenience function for instantiating a Driver from a WebDriver

  • Loading branch information...
1 parent 0778d02 commit 5e7a1cccf64f671110d328f4e9ec7e1a3d02e939 @semperos committed Feb 10, 2013
Showing with 13 additions and 0 deletions.
  1. +13 −0 src/clj_webdriver/core.clj
View
13 src/clj_webdriver/core.clj
@@ -198,6 +198,19 @@
:profile profile})
:cache-spec cache-spec}))))
+(defn new-from-webdriver
+ ([webdriver]
+ (Driver. webdriver nil nil nil)))
+
+;; Chrome binary, common location of Chromium on Linux
+(comment
+ (do
+ (import 'org.openqa.selenium.remote.DesiredCapabilities)
+ (let [cap (DesiredCapabilities/chrome)]
+ (.setCapability cap "chrome.binary" "/usr/lib/chromium-browser/chromium-browser")
+ (new-from-webdriver (ChromeDriver. cap))))
+)
+
(defn start
"Shortcut to instantiate a driver, navigate to a URL, and return the driver for further use"
([browser-spec url]

0 comments on commit 5e7a1cc

Please sign in to comment.