Skip to content

Commit

Permalink
Clarify issues with :active in User Guide and query doc string
Browse files Browse the repository at this point in the history
  • Loading branch information
dgr committed Aug 17, 2024
1 parent 0bf7df1 commit c6ca224
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions doc/01-user-guide.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -512,13 +512,14 @@ The Google homepage, for example, automatically places the focus on the search i
;; Better
(e/go driver "https://google.com")
(e/fill-el driver (e/get-active-element driver) "Let's search for something" k/enter)
;; This case is so common that the API includes `fill-active`
;; Or best... This case is so common that the API includes `fill-active`
(e/go driver "https://google.com")
(e/fill-active driver "Let's search for something" k/enter)
----

* any other keyword is translated to an HTML ID attribute.
Note that this means that you cannot query for an HTML element with an ID of "active".
Note that you cannot query for an HTML element with an ID of "active" using this keyword syntax because the special keyword `:active` conflicts.
If you want to query for an element with an ID of "active", use the map syntax, described below (e.g., `{:id "active"}` or `{:id :active}`).
+
[source,clojure]
----
Expand Down
2 changes: 1 addition & 1 deletion src/etaoin/api.clj
Original file line number Diff line number Diff line change
Expand Up @@ -602,7 +602,7 @@
- a keyword to find element by it's ID attribute:
- `:my-id`
- (use `{:id \"my-id\"}` for ids that cannot be represented as keywords)
- Note that `:active` currently conflicts with this usage and therefore you
- Note that `:active` conflicts with this usage and therefore you
cannot search for a keyword named `:active` and expect to find an element
with ID equal to \"active\". In this case, use `{:id \"active\"}`.
- an XPath expression:
Expand Down

0 comments on commit c6ca224

Please sign in to comment.