This repository was archived by the owner on Nov 9, 2017. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 93
Getting Started
semperos edited this page Feb 18, 2012
·
6 revisions
Here's an example of logging into Github:
(use 'clj-webdriver.core)
(def b (start {:browser :firefox} "https://github.com"))
;; Click "Login" link
(-> b
(find-element {:text "Login"})
click)
;; Input username/email into the "Login or Email" field
(-> b
(find-element {:class "text", :name "login"}) ; use multiple attributes
(input-text "username"))
;; Input password into the "Password" field
(-> b
(find-element {:xpath "//input[@id='password']"}) ; even in "easy" mode, you still
(input-text "password")) ; have :xpath and :css options
;; Click the "Log in" button"
(-> b
(find-element {:tag :input, :value #"Log"}) ; use regular expressions
click) ; also used optional tag arg, :input
The clj-webdriver Wiki by Daniel Gregoire and community is licensed under a Creative Commons Attribution 4.0 International License. Based on a work at https://github.com/semperos/clj-webdriver/wiki.