A Clojure binding for Selenium WebDriver
Check out the CHANGELOG
When testing web applications -- especially in the context of
continuous integration testing -- you need to have a tool
to remotely control a web browser. This is essential for
developing and testing ClojureScript applications and
*.cljs
or *.cljc
libraries targeting the browser.
While clj-webdriver is a nice Clojure wrapper for Selenium it often falls behind in tracking upstream versions and, consequently, often breaks with new browsers (e.g. when the browser version exceeds the known range).
The purpose of webica is to generate a Clojure wrapper for Selenium making heavy use of introspection in the spirit of amazonica which should track Selenium (the Clojure source code can be generated nearly automatically) and expose new upstream APIs more quickly.
Because of the use of introspection it is not easy to generate
codox style API documents
(see #1). However every webica
namespace has a show-functions
function
to explain the symbols available in that namespace.
Obviously you need to have a web browser installed. Not as obviously you also need to have the corresponding driver installed:
- Firefox: geckodriver
- Chrome: chromedriver
- Safari: safaridriver
- Edge: webdriver
For using Clojure boot scripts (like the example below) or for developing webica please install boot if you haven't done so already.
For more on boot see Sean's blog and the boot Wiki. This is how Clojure boot scripts work.
Check out the example Clojure boot script using webica that imitates Let me Google that for you on the command line.
./examples/lmgtfy ClojureScript for thought
Please see CONTRIBUTING for details on how to make a contribution.
Note that webica does not yet have complete coverage of all Selenium classes.
Here are some helpful Selenium links
- Selenium Java API
- Guava API used by Selenium
- Selenium source code -- see the Java CHANGELOG
Logging is controlled by the following environment variables:
- WEBICA_LOG the name of the log file [webica.log]
- WEBICA_LEVEL the desired log level [warn] must be one of:
#{"trace" "debug" "info" "warn" "error" "fatal" "report"}
Copyright © 2016 Tom Marble
Licensed under the Apache License 2.0 LICENSE