Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Low level Wrappers

semperos edited this page · 1 revision

The following is an example of logging into Github, leveraging the lowest-level functions that provide the thinnest layer over WebDriver's API:

    ;;; The Harder, Lower-Level Way ;;;

    (def b (start {:browser :firefox} "https://github.com"))

    ;; Click "Login" link
    (->> "//ul[@class='nav logged_out']/li/a[text()='Login']"
         by-xpath
         (find-element-by b)
         click)

    ;; Input username/email into the "Login or Email" field
    (input-text (->> "login_field"
                      by-id
                      (find-element-by b))
                "username")

    ;; Input password into the "Password" field
    (input-text (->>  "password"
                      (by-attr= :name)
                      (find-element-by b))
                "password")

    ;; Click the "Log in" button
    (->> "body.logged_out div#login.login_form label.submit_btn input"
         by-css-selector
         (find-element-by b)
         click)
Something went wrong with that request. Please try again.