Permalink
Browse files

Add same compound class name support to by-class-name

  • Loading branch information...
1 parent d6bd847 commit 3112ce759a3bc20fb1e5fff90488399792865c69 @semperos semperos committed Jan 18, 2012
Showing with 7 additions and 1 deletion.
  1. +7 −1 src/clj_webdriver/core_by.clj
@@ -33,7 +33,13 @@
(defn by-class-name
"Used when finding elements. Returns `By/className` of `expr`"
[expr]
- (By/className (name expr)))
+ (let [expr (str expr)]
+ (if (re-find #"\s" expr)
+ (by-xpath (str "//*"
+ "[@class='"
+ expr
+ "']"))
+ (By/className (name expr)))))
(defn by-css-selector
"Used when finding elements. Returns `By/cssSelector` of `expr`"

0 comments on commit 3112ce7

Please sign in to comment.