Skip to content
Browse files

Quick repl test

  • Loading branch information...
1 parent eeae9ba commit 1dbcd55d235bc7468a7b534e7cf0927b850bc3b5 @manutter51 committed
Showing with 17 additions and 3 deletions.
  1. +4 −3 project.clj
  2. +13 −0 src/salty/impl.clj
View
7 project.clj
@@ -1,3 +1,4 @@
-(defproject salty "1.0.0-SNAPSHOT"
- :description "FIXME: write description"
- :dependencies [[org.clojure/clojure "1.2.1"]])
+(defproject salty "0.0.1-SNAPSHOT"
+ :description "Clojure wrapper for Selenium Java WebDriver."
+ :dependencies [[org.clojure/clojure "1.2.1"]
+ [org.seleniumhq.selenium/selenium-java "2.11.0"]])
View
13 src/salty/impl.clj
@@ -0,0 +1,13 @@
+(ns salty.impl
+ (:import [org.openqa.selenium By WebDriver WebElement]
+ org.openqa.selenium.firefox.FirefoxDriver
+ [org.openqa.selenium.support.ui ExpectedCondition WebDriverWait]))
+
+;; Convenience test, just to have something quick to type at the repl
+(defn test-with-google []
+ (let [driver (FirefoxDriver.)]
+ (.get driver "http://www.google.com/")
+ (let [element (.findElement driver (By/name "q"))]
+ (.sendKeys element (into-array ["clojure\n"]))
+ (.submit element)
+ (println "Page title is " (.getTitle driver)))))

0 comments on commit 1dbcd55

Please sign in to comment.
Something went wrong with that request. Please try again.