Coder Social home page Coder Social logo

etuk's Introduction

etuk - Simple driver of Selenium via Webica

https://img.shields.io/clojars/v/etuk.svg

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

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

Basic Usage

(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))))))

Development

Leiningen/Boot

[etuk "0.1.0"]

Gradle

compile "etuk:etuk:0.1.0"

Maven

<dependency>
  <groupId>etuk</groupId>
  <artifactId>etuk</artifactId>
  <version>0.1.0</version>
</dependency>

Useful Links

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.

etuk's People

Contributors

agilecreativity avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.