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

Getting connection refused. #218

Open
lowks opened this issue Jun 25, 2018 · 5 comments
Open

Getting connection refused. #218

lowks opened this issue Jun 25, 2018 · 5 comments

Comments

@lowks
Copy link
Contributor

lowks commented Jun 25, 2018

I am trying to setup hound to run for my project. In mix.exs I added the dependencies:

{:hound, "~> 1.0"}

My config/test.exs looks like this:

+config :hound, driver: "phantomjs"

My test looks like this:

defmodule BasicBrowserSessionTest do
  use ExUnit.Case
  use Hound.Helpers

  hound_session

  test "Basic test." do
    url1 = "http://www.abc.com"
    navigate_to(url1)  
  end
end

The error I get:

BasicBrowserSessionTest
  * test Basic Test. (1057.3ms)
03:36:08.360 [error] GenServer Hound.SessionServer terminating
** (RuntimeError) could not create a new session: econnrefused, check webdriver is running
    (hound) lib/hound/session_server.ex:101: Hound.SessionServer.create_session/2
    (hound) lib/hound/session_server.ex:78: Hound.SessionServer.handle_call/3
    (stdlib) gen_server.erl:636: :gen_server.try_handle_call/4
    (stdlib) gen_server.erl:665: :gen_server.handle_msg/6
    (stdlib) proc_lib.erl:247: :proc_lib.init_p_do_apply/3
Last message (from #PID<0.598.0>): {:change_session, #PID<0.598.0>, :default, []}

My test_helper.exs

Application.ensure_all_started(:hound)
{:ok, _} = Application.ensure_all_started(:ex_machina)
ExUnit.start()
Ecto.Adapters.SQL.Sandbox.mode(UrboxApi.Repo, :manual)

I run phantomjs in another session by issuing the command phantomjs --wd

Can someone let me know what I am missing here ?

@CaioPenhalver
Copy link

I'm having the same problem here. I mean I'm not pretty sure if it's a issue or if it's the way that supposed to be!

@onelesd
Copy link

onelesd commented Oct 23, 2018

Have you tried configuring the webdriver port?

config :hound,
  driver: "phantomjs",
  host: "http://localhost",
  port: 8910
phantomjs --webdriver=127.0.0.1:8910

@JGjumpshot
Copy link

JGjumpshot commented Jan 20, 2020

I have this issue with chromedriver any recommendations? @HashNuke

@jaydorsey
Copy link

@JGjumpshot I may be remembering incorrectly, but I think chromedriver (thru homebrew) used to be managed thru brew services (and may have started automatically even?), but that appears to have changed so you probably manually need to start it.

You may need to configure the port, per the earlier comment, and start the chromedriver with chromedriver (assuming it's on your path). When you start it, it will output which port it's running on (you can also specify via chromedriver options when you start it)

@philippneugebauer
Copy link

If you installed chromedriver via brew, you need to execute /usr/local/bin/chromedriver or the output of which chromedriver

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

6 participants