Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to start chrome or Firefox driver using etaoin #229

Closed
zendevil opened this issue May 13, 2020 · 3 comments
Closed

Unable to start chrome or Firefox driver using etaoin #229

zendevil opened this issue May 13, 2020 · 3 comments

Comments

@zendevil
Copy link

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

nilnil
user> (def driver (chrome))

I get the error:


2. Unhandled clojure.lang.Compiler$CompilerException
   Error compiling form-init3678264593908236466.clj at (53:19)
   #:clojure.error{:phase :execution,
                   :line 53,
                   :column 19,
                   :source "form-init3678264593908236466.clj"}
                    ........
1. Caused by clojure.lang.ExceptionInfo
   throw+: {:response {:sessionId "73c8caf2d8989efccbb27778acb523ad", :status
   13, :value {:message "unknown error: cannot find Chrome binary\n (Driver
   info: chromedriver=81.0.4044.138
   (8c6c7ba89cc9453625af54f11fd83179e23450fa-refs/branch-heads/4044@{#999}),platform=Mac
   OS X 10.15.4 x86_64)"}}, :path "session", :payload {:desiredCapabilities
   {:loggingPrefs {:browser "ALL"}}}, :method :post, :type :etaoin/http-error,
   :port 19716, :host "127.0.0.1", :status 200, :driver {:args ("chromedriver"
   "--port=19716"), :capabilities {:loggingPrefs {:browser "ALL"}}, :process
   #object[java.lang.UNIXProcess 0x2237ad71 "java.lang.UNIXProcess@2237ad71"],
   :locator "xpath", :type :chrome, :env nil, :port 19716, :host "127.0.0.1",
   :url "http://127.0.0.1:19716"}}
   {:response
    {:sessionId "73c8caf2d8989efccbb27778acb523ad",
     :status 13,
     :value
     {:message
      "unknown error: cannot find Chrome binary\n  (Driver info: chromedriver=81.0.4044.138 (8c6c7ba89cc9453625af54f11fd83179e23450fa-refs/branch-heads/4044@{#999}),platform=Mac OS X 10.15.4 x86_64)"}},
    :path "session",
    :payload {:desiredCapabilities {:loggingPrefs {:browser "ALL"}}},
    :method :post,
    :type :etaoin/http-error,
    :port 19716,
    :host "127.0.0.1",
    :status 200,
    :driver
    {:args ("chromedriver" "--port=19716"),
     :capabilities {:loggingPrefs {:browser "ALL"}},
     :process
     #object[java.lang.UNIXProcess 0x2237ad71 "java.lang.UNIXProcess@2237ad71"],
     :locator "xpath",
     :type :chrome,
     :env nil,
     :port 19716,
     :host "127.0.0.1",
     :url "http://127.0.0.1:19716"}}

How do I fix this?

@obiSerra
Copy link

It looks like Clojure cannot find the binary for Chrome (or Firefox).
I had the same problem that I solved looking for the path of the browser binary and passing it the run-driver function like:

(api/run-driver (api/create-driver :firefox) {:path-driver "/mnt/c/Program Files/Mozilla Firefox/firefox.exe"})



@scottlowe
Copy link
Contributor

scottlowe commented May 28, 2020

This isn't really a fair question or issue for the Etaoin project - it's a straight up Chrome / Chromedriver issue.

Regardless, the answer is right there in your pasted error - chromedriver can't find the Chrome binary installed in the expected location on your OS.

These are the expected locations for each supported OS:
https://github.com/SeleniumHQ/selenium/wiki/ChromeDriver

Your version of ChromeDriver should also match your version of Chrome as closely as possible. Because you're using homebrew, you can update chromedriver with brew cask upgrade chromedriver.

ghufransyed added a commit to ghufransyed/etaoin that referenced this issue Jun 3, 2020
Move the section on driver installation to be next to the part on library installation, to avoid misunderstandings by beginners e.g.(clj-commons#229). Also fixed typo.
igrishaev pushed a commit that referenced this issue Jul 20, 2020
Move the section on driver installation to be next to the part on library installation, to avoid misunderstandings by beginners e.g.(#229). Also fixed typo.
@igrishaev
Copy link
Collaborator

As it was already mentioned, in a case the driver cannot discover the browser, you can help it by providing the :path-driver key. That happens sometimes when the driver is outdated or maybe you installed the browser using a non-standard way.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants