Unable to start chrome or Firefox driver using etaoin

Viewed 87

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"}}

1 Answers

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).

Related