-
-
Notifications
You must be signed in to change notification settings - Fork 198
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
HTTPoison issue on any URL #351
Comments
On reflection, I'm not sure I'm right about the JSON issue, since I suppose Wallaby would have to be making requests to the PhantomJS endpoint, not directly to the desired HTML page. But I definitely can't get Wallaby to visit any page successfully, even though those pages can successfully be seen by a client such as HTTPoison. |
Oh, and I'm using PhantomJS 2.1.1 and setting |
I think I was wrong about the root cause here: > {status, %HTTPoison.Response{}} = HTTPoison.get session.url
> status
:ok
> HTTPoison.post session.url, Poison.encode!(%{url: Endpoint.url})
{:error, %HTTPoison.Error{id: nil, reason: :timeout}} So for some reason the session URL (that's the PhantomJS endpoint, right?) is timing out on POST but not on GET. |
I think there was a twofold problem.
So...problem solved by switching to phantom-prebuilt and not setting |
@marnen thanks for the investigation. It might be worth specifying what version of phantomjs we expect, yes :) |
Not sure why this was closed, given that the docs were never updated... |
If you would like to submit a PR that updates the docs then that would be great. Otherwise we're planning on moving to chrome as the default driver since phantom is deprecated so this problem will be lessened. |
Oh, OK. If this is moot then I won’t bother, but I’ll try to add a sentence or two. |
I'm running Wallaby 0.19.2 on a Debian Jessie Docker container (hosted on Mac OS X) with Elixir 1.6. Whenever I do
session |> visit(any URL whatsoever)
, I get the following error:HTTPoison seems to be retrieving the pages just fine, but I believe the problem is that Wallaby is attempting to decode the resulting HTML as if it were JSON (see https://github.com/keathley/wallaby/blob/v0.19.2/lib/wallaby/httpclient.ex#L54, where the first thing it does is run
Poison.decode(body)
, which fails since the result isn't JSON). Help?The text was updated successfully, but these errors were encountered: