3

I'm using the etaoin library to test for chrome and firefox. I have both chromedriver and gecko driver installed using brew in macOS. But when I try using them in the repl, like so:

user> (use 'etaoin.api)
(require '[etaoin.keys :as k])

-- EDIT -- for firefox: When trying


(def driver (Firefox))


1. Caused by clojure.lang.ExceptionInfo
   throw+: {:response {:value {:error "unknown error", :message "invalid
   argument: can't kill an exited process", :stacktrace ""}}, :path "session",
   :payload {:desiredCapabilities {:loggingPrefs {:browser "ALL"}}}, :method
   :post, :type :etaoin/http-error, :port 47131, :host "127.0.0.1", :status 500,
   :driver {:args ("geckodriver" "--port" 47131), :capabilities {:loggingPrefs
   {:browser "ALL"}}, :process #object[java.lang.UNIXProcess 0x2ec0e260
   "java.lang.UNIXProcess@2ec0e260"], :locator "xpath", :type :firefox, :env
   nil, :port 47131, :host "127.0.0.1", :url "http://127.0.0.1:47131"}}
   {:response
    {:value
     {:error "unknown error",
      :message "invalid argument: can't kill an exited process",
      :stacktrace ""}},
    :path "session",
    :payload {:desiredCapabilities {:loggingPrefs {:browser "ALL"}}},
    :method :post,
    :type :etaoin/http-error,
    :port 47131,
    :host "127.0.0.1",
    :status 500,
    :driver
    {:args ("geckodriver" "--port" 47131),
     :capabilities {:loggingPrefs {:browser "ALL"}},
     :process
     #object[java.lang.UNIXProcess 0x2ec0e260 "java.lang.UNIXProcess@2ec0e260"],
     :locator "xpath",
     :type :firefox,
     :env nil,
     :port 47131,
     :host "127.0.0.1",
     :url "http://127.0.0.1:47131"}}

zendevil.eth
  • 974
  • 2
  • 9
  • 28

1 Answers1

1

It looks like the chromedriver cannot find Chrome. Do you have Chrome installed? If not, install it. If you have, maybe it cannot find Chrome. Try to install it in the expected location (/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome).

user2609980
  • 10,264
  • 15
  • 74
  • 143
  • okay yeah. I have chrome canary not chrome. But why isn't geckodriver working, i.e., (def driver (Firefox))? – zendevil.eth May 13 '20 at 19:34
  • That one arises when Firefox cannot be opened. Looks like a version mismatch, see https://stackoverflow.com/questions/52534658/webdriverexception-message-invalid-argument-cant-kill-an-exited-process-with for help. Probably need to download a version of Firefox that works with the driver. See that answer for suggestion to what version. – user2609980 May 14 '20 at 15:22