Clojure Selenium driver via Webica wrapper in Clojure.
For this to work just open your command line and
cd ~/projects/
# Clone the webica project locally
git clone git@github.com:tmarble/webica.git
# Build the library for use locally
cd ~/projects/webica && boot build-jar
# Clone the patched version of webica project
git clone git@github.com:agilecreativity/etuk.git
# Then build it to your local repository
cd ~/projects/etuk && boot build-jar
# For example of the api try =src/etuk/examples/*.clj= for more detail
boot download-selenium
# To login to Github - need to setup sample configuration (edn file)
# Adjust to your local path e.g. ~/Dropbox/login/github.edn
# with content like the following
# { :username "your-github-user"
# :password "your-password"
# :url "https://github.com/login" }
boot login-github
- Excerpted from core.clj
(ns etuk.core
(:require [etuk.browser-utils :refer [start-chrome-session start-firefox-session] :as but]
[etuk.core-wait :refer :all :as cwt]
[etuk.core-navigator :refer :all :as cnv]
[webica.remote-web-driver :as browser]
[webica.expected-conditions :as ec]
[webica.web-element :as element])
(:gen-class))
(defn download-selenium-jars
[]
(start-chrome-session)
(browser/get "http://www.seleniumhq.org/")
;; Click the big Download link
(cnv/navigate :wdriver (cwt/get-instance)
:wfn ec/presence-of-element-located
:type :css-selector
:expr "#sidebar > div.downloadBox > a"
:act-name element/click
:act-arg nil)
;; Then click on the download Selenium Java driver 3.3.0 version link
(cnv/navigate :wdriver (cwt/get-instance)
:wfn ec/presence-of-element-located
:type :css-selector
:expr "#mainContent > table:nth-child(13) > tbody > tr:nth-child(1) > td:nth-child(4) > a"
:act-name element/click
:act-arg nil))
(defn -main [& args]
(try
(download-selenium-jars)
(catch Exception e
(.printStackTrace e)
(println (str "Unexpected errors: " (.getMessage e))))))
[etuk "0.1.0"]
compile "etuk:etuk:0.1.0"
<dependency>
<groupId>etuk</groupId>
<artifactId>etuk</artifactId>
<version>0.1.0</version>
</dependency>
This is early stage of development so things will changes as this project evolve.
Copyright © 2017 agilecreativity
Distributed under the Eclipse Public License either version 1.0 or (at your option) any later version.