Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Add support for finding elements with compound class names in find-it

  • Loading branch information...
commit 676d7edf798971df6f1583883a9b899b8268692b 1 parent 238673e
Daniel Gregoire semperos authored
Showing with 7 additions and 1 deletion.
  1. +7 −1 src/clj_webdriver/core_by.clj
8 src/clj_webdriver/core_by.clj
View
@@ -48,7 +48,13 @@
([attr value] (by-attr= :* attr value)) ; default to * any tag
([tag attr value]
(cond
- (= :class attr) (by-class-name value)
+ (= :class attr) (if-not (re-find #"\s" value)
+ (by-class-name value)
+ (by-xpath (str "//"
+ (name tag)
+ "[@class='"
+ value
+ "']")))
(= :id attr) (by-id value)
(= :name attr) (by-name value)
(= :tag attr) (by-tag value)
Please sign in to comment.
Something went wrong with that request. Please try again.