Fork me on GitHub
#etaoin
<
2022-11-29
>
grumplet13:11:05

Anyone seeing this issue when starting a driver? ; Execution error (IllegalArgumentException) at etaoin.api/wait (api.clj:1854). Here’s a repl transcript. Using chrome 107 and its driver and etaoin 1.0.38

clj꞉user꞉> (require '[etaoin.api :as e])
nil
clj꞉user꞉> (e/chrome {:headless false})
; Execution error (IllegalArgumentException) at etaoin.api/wait (api.clj:1854).
; No matching method sleep found taking 1 args
clj꞉user꞉> 

stacktrace
clojure.lang.Reflector/invokeMatchingMethod (Reflector.java:154)
clojure.lang.Reflector/invokeStaticMethod (Reflector.java:332)
etaoin.api/wait (api.clj:1854)
etaoin.api/wait (api.clj:1849)
etaoin.api/wait-predicate (api.clj:1899)
etaoin.api/wait-predicate (api.clj:1870)

grumplet13:11:25

On OSX 12.6.1 (Monterey)

borkdude13:11:02

which JVM is this, 19?

grumplet13:11:29

openjdk version “19” 2022-09-20

grumplet13:11:51

You guessed right 🙂

borkdude13:11:53

how did I know! :)

wizard 1
lread13:11:23

I'll fix sometime today probably.

grumplet13:11:24

Great! Thanks again

grumplet13:11:54

That would be nice - thank you. Is there a known JVM that avoids the error?

lread14:11:13

Ya, JDK17 should be fine.

lread14:11:02

You are most welcome

borkdude14:11:10

you can also just write (Thread/sleep 1000) yourself?

lread14:11:35

I think etaoin is waiting internally... so might not be that easy.

👍 1
lread14:11:46

This, is the 3rd ping on this issue, so I should really get around to addressing in etaoin.

jjttjj14:11:55

I hit this problem just yesterday, a (big) hack around it for now (if you're just looking to do something quick) is just to redefine wait in the api ns then jump back to your ns, ie:

(in-ns 'etaoin.api)
(defn wait
  "Sleep for `seconds`."
  (#_{:clj-kondo/ignore [:unused-binding]} [driver seconds]
    (wait seconds))
  ([seconds]
   (Thread/sleep ^long (* seconds 1000))))

(in-ns 'your.ns)

borkdude14:11:50

yep, intern or alter-var-root will also do

jjttjj14:11:14

oh yeah, that's better