Skip to content

Instantly share code, notes, and snippets.

@joncol
Created December 16, 2019 16:09
Show Gist options
  • Save joncol/e1d60c39b2067287065dca35430954f0 to your computer and use it in GitHub Desktop.
Save joncol/e1d60c39b2067287065dca35430954f0 to your computer and use it in GitHub Desktop.
hello-selenium
;; Project dependencies:
;; [org.seleniumhq.selenium/selenium-chrome-driver "3.141.59"]
;; [org.seleniumhq.selenium/selenium-java "3.141.59"]
(ns hello-selenium.core
(:gen-class)
(:import [org.openqa.selenium By WebDriver WebElement]
[org.openqa.selenium.chrome ChromeDriver]))
(defn -main []
(let [driver (ChromeDriver.)]
(.get driver "http://www.google.com/")
(let [e (By/name "q")
search-box (.findElement driver e)]
(.sendKeys search-box (into-array ["getting started with Selenium"]))
(.submit search-box)
(Thread/sleep 5000)
(.quit driver))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment