Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/agilecreativity/etuk
Selenium wrapper to automate commonly used apis.
https://github.com/agilecreativity/etuk
automation clojure clojure-wrapper selenium-webdriver
Last synced: about 1 month ago
JSON representation
Selenium wrapper to automate commonly used apis.
- Host: GitHub
- URL: https://github.com/agilecreativity/etuk
- Owner: agilecreativity
- License: epl-1.0
- Created: 2017-04-20T00:56:45.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2017-12-13T07:27:51.000Z (almost 7 years ago)
- Last Synced: 2024-09-29T02:05:56.596Z (about 2 months ago)
- Topics: automation, clojure, clojure-wrapper, selenium-webdriver
- Language: Clojure
- Size: 24.4 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.org
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
** etuk - Simple driver of Selenium via Webica
#+ATTR_HTML: title="Clojars"
[[https://clojars.org/etuk][file:https://img.shields.io/clojars/v/etuk.svg]]#+ATTR_HTML: title="Jarkeeper"
[[https://jarkeeper.com/agilecreativity/etuk][file:https://jarkeeper.com/agilecreativity/etuk/status.svg]]Clojure Selenium driver via Webica wrapper in Clojure.
*** Basic Installation
For this to work just open your command line and
**** You will need to make sure that =chromedriver= is installed in =/usr/local/bin=
**** For Firefox drive you will need =geckodriver= and must be installed to =/usr/local/bin=#+BEGIN_SRC sh
cd ~/projects/# Clone the webica project locally
git clone [email protected]:tmarble/webica.git# Build the library for use locally
cd ~/projects/webica && boot build-jar# Clone the patched version of webica project
git clone [email protected]: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
#+END_SRC*** Basic Usage
- Excerpted from [[src/etuk/core.clj][core.clj]]
#+BEGIN_SRC clojure
(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))))))
#+END_SRC*** Development
**** Leiningen/Boot
#+BEGIN_SRC clojure
[etuk "0.1.0"]
#+END_SRC**** Gradle
#+BEGIN_SRC groovy
compile "etuk:etuk:0.1.0"
#+END_SRC**** Maven
#+BEGIN_SRC xml
etuk
etuk
0.1.0#+END_SRC
** Useful Links
- [[http://selenium-python.readthedocs.io/api.html#desired-capabilities][desired-capabilities]]
- [[http://selenium-python.readthedocs.io/api.html#module-selenium.webdriver.support.expected_conditions][module-selenium.webdriver.support.expected_conditions]]** Warning:
This is early stage of development so things will changes as this project evolve.
** License
Copyright © 2017 agilecreativity
Distributed under the Eclipse Public License either version 1.0 or (at
your option) any later version.