This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-06-02
Channels
- # announcements (34)
- # babashka (19)
- # beginners (106)
- # calva (50)
- # cider (25)
- # clj-commons (39)
- # clj-kondo (16)
- # clojure (59)
- # clojure-czech (3)
- # clojure-europe (33)
- # clojure-norway (9)
- # clojure-seattle (1)
- # clojure-sweden (1)
- # clojure-uk (2)
- # clojured (28)
- # clojuredesign-podcast (1)
- # clojurescript (7)
- # code-reviews (19)
- # conjure (15)
- # cursive (3)
- # datomic (3)
- # emacs (21)
- # etaoin (28)
- # graphql (4)
- # introduce-yourself (1)
- # joyride (2)
- # kaocha (2)
- # london-clojurians (8)
- # lsp (24)
- # music (4)
- # nbb (4)
- # nextjournal (1)
- # off-topic (13)
- # other-languages (16)
- # remote-jobs (1)
- # rewrite-clj (6)
- # sci (1)
- # shadow-cljs (40)
- # tools-deps (15)
I’m having a weird problem with etaoin and chromedriver. The following expression finds my desired element from the devtools console: $x(".//span[text()='Edit']")
. However, none of the following etaoin calls return any elements:
(query-all driver [{:tag :span :fn/text "Edit"}])
(query-all driver {:xpath ".//span[text()='Edit]"})
BTW (query-all driver {:xpath ".//span"})
works fine, returning all the spans. It seems to be something in the xpath conditional clause.
Hrm, looks like a chromedriver issue. The following also throws the error “Unable to locate element”:
(execute {:driver driver
:method :post
:path [:session (:session driver) :element]
:data {:using "xpath" :value ".//span[text()='Edit']"}})
Hiya @jkrasnay, this type of query is working for me on macOS with chrome and chromedriver both at version 102.0.5005.61
(off etaoin master). Can you share your html snippit? Your search above is for an exact match so maybe there is some case-sensitivity or extra space?
I successfully tried:
(e/query-all driver [{:tag :span :fn/text "Edit"}])
;; note your example above is missing the close single quote on Edit
(e/query-all driver {:xpath ".//span[text()='Edit']"})
Thanks @lee. I think it’s something particular to my setup. Weirdly, (a) the same xpath that fails when going through the driver succeeds when at the devtools console, so I think that rules out problems with case, weird spacing, etc., and (b) I get the exact same broken behaviour with chromedriver and msedgedriver.
The only thing I can think of is that both of those are managed by my company’s group policy, but that seems pretty unlikely since most stuff works fine.
If you clone etaoin master I have added a bb tools-versions
which might be handy to report back on what versions of drivers and browsers you are running.
If you can I’d start real small, just a html file with <span>Edit</span>
and see if you can reproduce. Maybe there is something else in the html that is tripping things up?
Cool, let us know how it goes. And if you can, report back versions of chrome and chromedriver. I’ll also fire up that Windows VM if you find you are still stuck.