Created
March 12, 2012 13:27
-
-
Save ponkore/2021925 to your computer and use it in GitHub Desktop.
clj-webdriver tiny example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns clj-selenium-test.core | |
(:use [clj-webdriver.taxi])) | |
(defn auto-login [] | |
"http://www.walk-21.com に自動ログインする。REPL にて | |
user=> (use 'clj-selenium-test.core) | |
user=> (auto-login) | |
" | |
;; top 画面を表示 | |
(set-driver! {:browser :firefox} "http://www.walk-21.com/") | |
(click (find-element {:tag :img, :name "Image8"})) ; ここで画面遷移 | |
;; login 画面 | |
(input-text (find-element {:tag :input, :name "LOGIN_ID"}) "<login id>") | |
(input-text (find-element {:tag :input, :name "PASSWORD"}) "<password>") | |
(click (find-element {:tag :img, :src "img/btn_login.gif"})) ; ここで画面遷移 | |
;; ログイン直後の状態となる。 | |
;; (take-screenshot :file "/Users/Masao/Desktop/a.png") ; スクリーンショットを取る | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment