Created
December 16, 2019 16:09
-
-
Save joncol/e1d60c39b2067287065dca35430954f0 to your computer and use it in GitHub Desktop.
hello-selenium
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; 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